-
Notifications
You must be signed in to change notification settings - Fork 0
/
BOJ_11292.cpp
50 lines (47 loc) · 871 Bytes
/
BOJ_11292.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
49
50
#include<iostream>
#include<vector>
#include<list>
#include<queue>
#include<cmath>
#include<string>
#include<algorithm>
#include<cstring>
#include<functional>
#include<cstdio>
#include<stack>
#pragma warning(disable:4996)
#define INTMAX 0x7fffffff
#define gets(x) cin.getline(x,sizeof(x))
#define square(x) (x)*(x)
using namespace std;
int main(void) {
string max_name[50], str;
float max = -INTMAX;
int n, cnt;
float k;
while (1) {
cin >> n;
if (n == 0) break;
cnt = 0;
for (int i = 0; i < n; i++) {
cin >> str >> k;
if (k > max) {
for (int i = 0; i < 50; i++)
max_name[i] = "";
cnt = 0;
max = k;
max_name[cnt++] = str;
}
else if (k == max) {
max_name[cnt++] = str;
}
}
for (int i = 0; i < cnt; i++)
cout << max_name[i] << " ";
cout << endl;
max = -INTMAX;
cnt = 0;
}
// system("pause");
return 0;
}