답안 #944499

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
944499 2024-03-12T19:36:37 Z rainboy 올림픽 (KOI13_olympic) C
100 / 100
1 ms 436 KB
#include <stdio.h>

#define N	1000

int main() {
	static int gg[N], ss[N], bb[N];
	int n, h, i, i_, r;

	scanf("%d%d", &n, &i_), i_--;
	for (h = 0; h < n; h++) {
		scanf("%d", &i), i--;
		scanf("%d%d%d", &gg[i], &ss[i], &bb[i]);
	}
	r = 1;
	for (i = 0; i < n; i++)
		if (gg[i] > gg[i_] || gg[i] == gg[i_] && (ss[i] > ss[i_] || ss[i] == ss[i_] && bb[i] > bb[i_]))
			r++;
	printf("%d\n", r);
	return 0;
}

Compilation message

olympic.c: In function 'main':
olympic.c:16:79: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   16 |   if (gg[i] > gg[i_] || gg[i] == gg[i_] && (ss[i] > ss[i_] || ss[i] == ss[i_] && bb[i] > bb[i_]))
      |                                                               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
olympic.c:16:41: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   16 |   if (gg[i] > gg[i_] || gg[i] == gg[i_] && (ss[i] > ss[i_] || ss[i] == ss[i_] && bb[i] > bb[i_]))
      |                         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
olympic.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d", &n, &i_), i_--;
      |  ^~~~~~~~~~~~~~~~~~~~~~
olympic.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d", &i), i--;
      |   ^~~~~~~~~~~~~~~
olympic.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d%d%d", &gg[i], &ss[i], &bb[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 424 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct