Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std ;
- struct team{
- int id, ind, solved ;
- }ar[ 100005 ] ;
- bool cmp( const team &a, const team &b ){
- return a.solved > b.solved ;
- }
- int main( ){
- int n ;
- cin >> n ;
- for( int i = 0 ; i < n ; i++ ){
- cin >> ar[ i ].id >> ar[ i ].solved ;
- ar[ i ].ind = i ;
- }
- sort( ar, ar + n, cmp ) ;
- for( int i = 0 ; i < n ; i++ ){
- cout << ar[ i ].id << " " << ar[ i ].solved << '\n' ;
- }
- }
Add Comment
Please, Sign In to add comment