提交时间:2023-08-23 10:43:35
运行 ID: 99571
#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 <= maxa;i++){ for (int j = 1;j <= maxb;j++){ if (f[i][j]){ cout<<i<<" "<<j<<'\n'; } } } return 0; }