-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path14593.cpp
52 lines (48 loc) · 970 Bytes
/
14593.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
51
52
// 14593. 2017 아주대학교 프로그래밍 경시대회 (Large)
// 2021.10.05
// 구현
#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int s, c, l;
int maxS = 0;
int minC = 0;
int minL = 0;
int maxIdx = 0;
for (int i = 1; i <= n; i++)
{
cin >> s >> c >> l;
if (maxS < s)
{
maxIdx = i;
maxS = s;
minC = c;
minL = l;
}
else if (maxS == s)
{
if (minC == c)
{
if (minL > l)
{
maxIdx = i;
maxS = s;
minC = c;
minL = l;
}
}
else if (minC > c)
{
maxIdx = i;
maxS = s;
minC = c;
minL = l;
}
}
}
cout << maxIdx << endl;
return 0;
}