-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSBETS.cpp
More file actions
38 lines (35 loc) · 859 Bytes
/
SBETS.cpp
File metadata and controls
38 lines (35 loc) · 859 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
/* http://www.spoj.com/problems/SBETS/ */
#include<string>
#include<stdio.h>
#include<map>
#include<iostream>
using namespace std;
int main(){
//freopen ("SBETS.in","r",stdin);
map<string,int> myMap;
map<string,int>::iterator it;
string team1,team2;
int T,goals1, goals2;
scanf("%d",&T);
for(int i=0;i<T;i++){
for(int j=0;j<16;j++){
cin>>team1>>team2;
scanf("%d",&goals1);
scanf("%d",&goals2);
if(goals1>goals2){
myMap[team1]++;
}else{
myMap[team2]++;
}
}
for (it=myMap.begin(); it!=myMap.end(); ++it){
if(it->second==3){
printf("%s\n",it->first.c_str());
break;
}
}
myMap.clear();
}
//fclose (stdin);
return 0;
}