提交时间:2023-08-23 10:41:42
运行 ID: 99569
#include<bits/stdc++.h> using namespace std; bool 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] = true; maxa = max(maxa,a); maxb = max(maxb,b); } for (int i = 1;i <= maxb;i++){ for (int j = 1;j <= maxa;j++){ if (f[j][i]){ cout<<j<<" "<<i<<'\n'; } } } return 0; }