SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. #define forn(i,n) for (int i = 0; i < (int)(n); ++i)
  4. #define for1(i,n) for (int i = 1; i <= (int)(n); ++i)
  5. #define ford(i,n) for (int i = (int)(n) - 1; i >= 0; --i)
  6. #define pb push_back
  7. #define mp make_pair
  8.  
  9. using namespace std;
  10.  
  11. typedef long long i64;
  12. typedef vector<int> vi;
  13. typedef vector<i64> vi64;
  14. typedef vector<vi> vvi;
  15. typedef vector<vi64> vvi64;
  16. typedef double ld;
  17.  
  18. int main (){
  19.     ios::sync_with_stdio(false);
  20.     cin.tie(0);
  21.     cout.precision(10);
  22.     cout<<fixed;
  23.     int n, t, a, k=0, pos;
  24.     string s;
  25.     cin>>n>>t;
  26.     vector < pair<int, string> > players;
  27.     vector < pair<string, int> > time;
  28.     forn(i, n){
  29.         cin>>s>>a;
  30.         players.pb(mp(a,s));
  31.     }
  32.     sort(players.begin(), players.end());
  33.     for(int i = 1; i<=t;++i){
  34.         cout<<"Time "<<i<<endl;
  35.         while(1){
  36.             pos=n-i-k*t;
  37.             if(pos<0)
  38.                 break;
  39.             else
  40.                 time.pb(mp(players[pos].second, players[pos].first));
  41.             k++;
  42.         }
  43.         sort(time.begin(), time.end());
  44.         for(int j = 0; i<(int) time.size();++j)
  45.             cout<<time[j].first<<endl;
  46.         time.clear();
  47.         k=0;
  48.     }
  49.     return 0;
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top