Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
134272 | 李树强 | 双关键字排序 | C++ | 通过 | 100 | 407 MS | 1032 KB | 441 | 2024-03-02 15:19:47 |
#include<iostream> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; struct cb{ int x, y; bool operator < (const cb & o) const{ if(x == o.x){ return y < o.y; } return x < o.x; } } a[N]; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> a[i].x >> a[i].y; } sort(a, a + n); for(int i = 0; i < n; i++){ cout << a[i].x << ' ' << a[i].y << endl; } return 0; }