|
|
back to boardIt is not good but it is right,just a "basket" sorting #include <iostream> using namespace std; long long n,i,j,x,y; long long a[101][1500000]; long long b[101]; int main () { cin>>n; for (i=0;i<101;i++) b[i]=0; for (i=0;i<n;i++) { cin>>x>>y; a[y][b[y]]=x; b[y]++; } for (i=101;i>=0;i--) for (j=0;j<b[i];j++) cout<<a[i][j]<<" "<<i<<endl; return (0); } |
|
|