Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,f=0;
- cin>>t;
- while(t--)
- {
- vector<pair<pair<int,int>,int> >v;
- bool flag[200]= {false};
- v.clear();
- map<pair<int,int>,bool>mp;
- map<pair<int,int>,int>cmp;
- int per,pro,time;
- string ver;
- while(cin>>per>>pro>>time>>ver)
- {
- flag[per] = true;
- v[per].second = per;
- if(ver[0]=='C' && mp[ {per,pro}]==false)
- {
- v[per].first.first--;
- v[per].first.second += (time+cmp[ {per,pro}]);
- mp[ {per,pro}]=true;
- }
- else if(ver[0]=='I')
- {
- cmp[ {per,pro}]+=20;
- }
- }
- sort(v.begin(),v.end());
- if(f)
- cout<<endl;
- f=1;
- for(int i=0; i<101; i++)
- {
- if(flag[v[i].second])
- cout<<v[i].second<<" "<<v[i].first.first*-1<<" "<<v[i].first.second<<endl;
- }
- mp.clear();
- cmp.clear();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement