forked from Shubham28/SPOJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFEELUCK.cpp
48 lines (38 loc) · 763 Bytes
/
FEELUCK.cpp
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 <list>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <stdio.h>
#include <cstring>
#define FOR(A,B,C) for(int A=B;A<C;A++)
#define EFOR(A,B,C) for(int A=B;A<=C;A++)
#define RFOR(A,B,C) for(int A=B;A>=C;A--)
#define MEM(A,B) memset(A,B,sizeof(A))
#define PB(A,B) A.push_back(B);
#define SZ(A) int(A.size())
using namespace std;
int main()
{
int T;
list<string>URL[101];
list<string>::iterator it;
string tmp;
int val;
cin>>T;
EFOR(cs,1,T){
EFOR(cl,0,100)
URL[cl].clear();
int mx=0;
FOR(a,0,10){
cin>>tmp;
scanf("%d",&val);
PB(URL[val],tmp);
mx=max(mx,val);
}
printf("Case #%d:\n",cs);
for(it=URL[mx].begin();it!=URL[mx].end();it++)
cout<<(*it)<<"\n";
}
return 0;
}