| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 167292 | 罗嘉为 | 双关键字排序 | C++ | Accepted | 100 | 533 MS | 1040 KB | 403 | 2024-08-19 16:19:23 |
#include <bits/stdc++.h> using namespace std; struct node{ int a, b; }a[100005]; bool cmp(node x, node y){ if(x.a == y.a) return x.b < y.b; return x.a < y.a; } int main(){ int n; cin >> n; for(int i = 1; i <= n; i++){ cin >> a[i].a >> a[i].b; } sort(a + 1, a + 1 + n, cmp); for(int i = 1; i <= n; i++){ cout << a[i].a << " " << a[i].b << endl; } return 0; }