-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUva12015.cpp
More file actions
49 lines (43 loc) · 960 Bytes
/
Copy pathUva12015.cpp
File metadata and controls
49 lines (43 loc) · 960 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <algorithm>
#include <map>
using namespace std;
typedef pair<string,int> si;
int main()
{
int T;
scanf("%d",&T);
int cas=0;
while(T--){
vector<si> coll;
string str;
int rel;
for(int i=0;i<10;i++){
cin>>str;
cin>>rel;
coll.push_back(make_pair(str,rel));
}
cas++;
int maxIndex=coll[0].second;
for(int i=1;i<coll.size();i++){
if(coll[i].second>maxIndex)maxIndex=coll[i].second;
}
vector<string> res;
for(int i=0;i<coll.size();i++){
if(coll[i].second==maxIndex){
res.push_back(coll[i].first);
}
}
cout<<"Case #"<<cas<<":"<<endl;
for(string r : res){
cout<<r<<endl;
}
}
return 0;
}