#include <iostream> using namespace std; int main() { int a, i, j, wei[200]{0}, hei[200]{0}, cnt=0; cin>>a; for(i=1;i<=a;i++) { cin>>wei[i]>>hei[i]; } for(i=1;i<=a;i++) { for(j=1;j<=a;j++) { if(wei[i]<wei[j]&&hei[i]<hei[j]) { cnt++; } } cout<<cnt+1<<" "; cnt=0; } return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter