Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- scanf("%d",&t);
- getchar();
- getchar();
- 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;
- char ver;
- char str[500];
- while(gets(str) && strlen(str)>0)
- {
- sscanf(str,"%d %d %d %c",&per,&pro,&time,&ver);
- flag[per] = true;
- v[per].second = per;
- if(ver=='C' && mp[ {per,pro}]==false)
- {
- v[per].first.first--;
- v[per].first.second += (time+cmp[ {per,pro}]);
- mp[ {per,pro}]=true;
- }
- else if(ver=='I')
- {
- cmp[ {per,pro}]+=20;
- }
- }
- sort(v.begin(),v.end());
- if(t)
- puts("");
- for(int i=0; i<101; i++)
- {
- if(flag[v[i].second])
- printf("%d %d %d\n",v[i].second,v[i].first.first*-1,v[i].first.second);
- }
- mp.clear();
- cmp.clear();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment