#include<iostream>
using namespace std;
#define MAX_NUM 1001
int medal[MAX_NUM][4];
int main() {
int num;
int cu;
cin >> num >> cu;
for (int i = 1; i <= num; i++) {
for (int j = 1; j < 4; j++) {
cin >> medal[i][j];
}
if (medal[i][0] == cu) {
cu = i;
}
}
int cnt = 1;
for (int i = 1; i <= num; i++) {
if (medal[i][1] > medal[cu][1]) {
cnt++;
}
else if (medal[i][1] == medal[cu][1] && medal[i][1] > medal[cu][1]) {
cnt++;
}
else if (medal[i][1] == medal[cu][1] && medal[i][1] == medal[cu][1] && medal[i][1] > medal[cu][1]) {
cnt++;
}
}
cout << cnt;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
252 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |