Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
166501 | Mino_XIE-谢文凯B班 | 双关键字排序 | C++ | 运行出错 | 0 | 49 MS | 2084 KB | 699 | 2024-08-19 14:43:55 |
#include<bits/stdc++.h> using namespace std; const int N = 1e6 + 10; const int INF = 0x3f3f3f3f; #define LL long long #define quick_cin_cout ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); struct node{ int x,y; }; vector<node > vec; bool cmp(node a,node b){ if (a.x == b.x) return a.y < b.y; return a.x < a.y; } int main(){ quick_cin_cout; int n; cin >> n; for (int i = 1;i <= n;i++){ int x,y; cin >> x >> y; vec.push_back(node{x,y}); } sort(vec.begin(),vec.end(),cmp); for (int i = 0;i < n;i++){ cout << vec[i].x << " " << vec[i].y <<endl; } return 0; } /*Note:*********************** *****************************/ //coder:Mino_XIE1212