提交时间:2023-08-23 10:24:49

运行 ID: 99566

#include <bits/stdc++.h> using namespace std; int v[2005][2005]; int n,x,y; signed main() { cin >> n; memset(v,0,sizeof(v)); for(int i = 1; i <= n; i++) { //scanf("%d%d",&x,&y); cin >> x >> y; v[x][y]++; } for(int i = 1; i <= 1000; i++) { for(int j = 1; j <= 1000; j++) { while(v[i][j]) { v[i][j]--; cout << i << " " << j << endl; } } } return 0; }