提交时间:2024-08-19 14:43:55
运行 ID: 166501
#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