提交时间:2023-08-23 10:49:53
运行 ID: 99577
#include<bits/stdc++.h> using namespace std; char f[10005][10005]; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n,maxa = 0,maxb = 0; cin>>n; for (int i = 1;i <= n;i++){ int a,b; cin>>a>>b; f[a][b]++; maxa = max(maxa,a); maxb = max(maxb,b); } for (int i = 1;i <= maxa;i++){ for (int j = 1;j <= maxb;j++){ if (f[i][j] > 0){ for (int k = 1;k <= f[i][j];k++){ cout<<i<<" "<<j<<'\n'; } } } } return 0; }