답안 #441657

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
441657 2021-07-05T17:33:20 Z rainboy Go (COCI16_go) C
50 / 50
1 ms 276 KB
#include <stdio.h>

#define N	70

int main() {
	static char ss[N][32];
	static int aa[N], bb[N];
	int n, i, i_, k_, sum;

	scanf("%d", &n);
	sum = 0, k_ = 0, i_ = -1;
	for (i = 0; i < n; i++) {
		int k;

		scanf("%s%d%d", ss[i], &aa[i], &bb[i]);
		k = (bb[i] - 2) / (aa[i] - 2);
		sum += k;
		if (k_ < k)
			k_ = k, i_ = i;
	}
	printf("%d\n", sum);
	printf("%s\n", ss[i_]);
	return 0;
}

Compilation message

go.c: In function 'main':
go.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
go.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%s%d%d", ss[i], &aa[i], &bb[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 276 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 0 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 0 ms 204 KB Output is correct
22 Correct 0 ms 204 KB Output is correct
23 Correct 0 ms 204 KB Output is correct
24 Correct 0 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct