Submission #57421

# Submission time Handle Problem Language Result Execution time Memory
57421 2018-07-15T02:19:54 Z hwangtmdals None (KOI17_card) C++14
100 / 100
24 ms 4080 KB
#include <cstdio>



int n;
int A[6], B[6];

int main()
{
	scanf("%d", &n);
	for(int i = 0; i<n; i++)
	{
		int a;
		scanf("%d", &a);
		for(int j = 0; j<a; j++)
		{
			int b;
			scanf("%d", &b);
			A[b]++;
		}

		scanf("%d", &a);
		for(int j = 0; j<a; j++)
		{
			int b;
			scanf("%d", &b);
			B[b]++;
		}

		int result = 'D';
		for(int j = 4; j>0; j--)
		{
			if(A[j]>B[j])
			{
				result = 'A';
				break;
			}
			else if(A[j]<B[j])
			{
				result = 'B';
				break;
			}
		}
		printf("%c\n", result);

		for(int j = 0; j<5; j++)
		{
			A[j] = 0;
			B[j] = 0;
		}


	}

	return 0;
}

Compilation message

card.cpp: In function 'int main()':
card.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
  ~~~~~^~~~~~~~~~
card.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a);
   ~~~~~^~~~~~~~~~
card.cpp:18:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d", &b);
    ~~~~~^~~~~~~~~~
card.cpp:22:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a);
   ~~~~~^~~~~~~~~~
card.cpp:26:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d", &b);
    ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 248 KB Output is correct
2 Correct 3 ms 488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 488 KB Output is correct
2 Correct 6 ms 532 KB Output is correct
3 Correct 6 ms 644 KB Output is correct
4 Correct 12 ms 924 KB Output is correct
5 Correct 10 ms 924 KB Output is correct
6 Correct 18 ms 1124 KB Output is correct
7 Correct 17 ms 1388 KB Output is correct
8 Correct 24 ms 1592 KB Output is correct
9 Correct 23 ms 1812 KB Output is correct
10 Correct 24 ms 2004 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 248 KB Output is correct
2 Correct 3 ms 488 KB Output is correct
3 Correct 3 ms 488 KB Output is correct
4 Correct 2 ms 488 KB Output is correct
5 Correct 6 ms 532 KB Output is correct
6 Correct 6 ms 644 KB Output is correct
7 Correct 12 ms 924 KB Output is correct
8 Correct 10 ms 924 KB Output is correct
9 Correct 18 ms 1124 KB Output is correct
10 Correct 17 ms 1388 KB Output is correct
11 Correct 24 ms 1592 KB Output is correct
12 Correct 23 ms 1812 KB Output is correct
13 Correct 24 ms 2004 KB Output is correct
14 Correct 15 ms 2208 KB Output is correct
15 Correct 17 ms 2456 KB Output is correct
16 Correct 19 ms 2700 KB Output is correct
17 Correct 16 ms 2856 KB Output is correct
18 Correct 15 ms 3052 KB Output is correct
19 Correct 18 ms 3252 KB Output is correct
20 Correct 20 ms 3588 KB Output is correct
21 Correct 18 ms 3668 KB Output is correct
22 Correct 17 ms 3880 KB Output is correct
23 Correct 23 ms 4080 KB Output is correct