답안 #917333

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
917333 2024-01-27T21:26:39 Z rainboy 딱지놀이 (KOI17_card) C
100 / 100
11 ms 856 KB
#include <stdio.h>
#include <string.h>

#define N	4

int main() {
	int t;

	scanf("%d", &t);
	while (t--) {
		static int kk[N];
		int k, i;
		char c;

		memset(kk, 0, N * sizeof *kk);
		scanf("%d", &k);
		while (k--) {
			scanf("%d", &i), i--;
			kk[i]++;
		}
		scanf("%d", &k);
		while (k--) {
			scanf("%d", &i), i--;
			kk[i]--;
		}
		c = 'D';
		for (i = N - 1; i >= 0; i--)
			if (kk[i] != 0) {
				c = kk[i] > 0 ? 'A' : 'B';
				break;
			}
		printf("%c\n", c);
	}
	return 0;
}

Compilation message

card.c: In function 'main':
card.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d", &t);
      |  ^~~~~~~~~~~~~~~
card.c:16:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |   scanf("%d", &k);
      |   ^~~~~~~~~~~~~~~
card.c:18:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |    scanf("%d", &i), i--;
      |    ^~~~~~~~~~~~~~~
card.c:21:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |   scanf("%d", &k);
      |   ^~~~~~~~~~~~~~~
card.c:23:4: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   23 |    scanf("%d", &i), i--;
      |    ^~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 3 ms 348 KB Output is correct
5 Correct 4 ms 436 KB Output is correct
6 Correct 7 ms 604 KB Output is correct
7 Correct 7 ms 604 KB Output is correct
8 Correct 7 ms 604 KB Output is correct
9 Correct 7 ms 632 KB Output is correct
10 Correct 11 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 600 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 2 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 3 ms 348 KB Output is correct
8 Correct 4 ms 436 KB Output is correct
9 Correct 7 ms 604 KB Output is correct
10 Correct 7 ms 604 KB Output is correct
11 Correct 7 ms 604 KB Output is correct
12 Correct 7 ms 632 KB Output is correct
13 Correct 11 ms 604 KB Output is correct
14 Correct 7 ms 604 KB Output is correct
15 Correct 7 ms 616 KB Output is correct
16 Correct 7 ms 604 KB Output is correct
17 Correct 7 ms 604 KB Output is correct
18 Correct 7 ms 604 KB Output is correct
19 Correct 8 ms 856 KB Output is correct
20 Correct 7 ms 604 KB Output is correct
21 Correct 8 ms 604 KB Output is correct
22 Correct 7 ms 604 KB Output is correct
23 Correct 7 ms 604 KB Output is correct