| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 193915 | luckypet | 双关键字排序 | C++ | Time Limit Exceeded | 80 | 1000 MS | 1036 KB | 588 | 2025-05-27 15:27:13 |
#include <iostream> #include <vector> #include <algorithm> using namespace std; struct Pair { int a, b; }; bool compare(const Pair& p1, const Pair& p2) { if (p1.a != p2.a) { return p1.a < p2.a; } return p1.b < p2.b; } int main() { int n; cin >> n; vector<Pair> pairs(n); for (int i = 0; i < n; ++i) { cin >> pairs[i].a >> pairs[i].b; } sort(pairs.begin(), pairs.end(), compare); for (const auto& p : pairs) { cout << p.a << " " << p.b << endl; } return 0; }