Submission #154758

# Submission time Handle Problem Language Result Execution time Memory
154758 2019-09-24T13:57:19 Z crisente235 올림픽 (KOI13_olympic) C++14
0 / 100
3 ms 376 KB
#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;
}

Compilation message

olympic.cpp: In function 'int main()':
olympic.cpp:20:7: warning: statement has no effect [-Wunused-value]
    cu == i;
    ~~~^~~~
# 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 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 252 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Incorrect 2 ms 376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 348 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 364 KB Output isn't correct
2 Halted 0 ms 0 KB -