提出 #66375323


ソースコード 拡げる

#include <stdio.h>

int M, N;
int A[114514];

int count[114514];

int main(void) {
	int i;
	if (scanf("%d%d", &N, &M) != 2) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) != 1) return 1;
		count[A[i]]++;
	}
	for (i = 1; i <= M; i++) {
		if (count[i] == 0) {
			puts("0");
			return 0;
		}
	}
	for (i = N - 1; i > 0; i--) {
		if (--count[A[i]] == 0) {
			printf("%d\n", N - i);
			return 0;
		}
	}
	puts("f*ck");
	return 0;
}

提出情報

提出日時
問題 B - Not All
ユーザ mikecat
言語 C (gcc 12.2.0)
得点 0
コード長 469 Byte
結果 WA
実行時間 1 ms
メモリ 1748 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 200
結果
AC × 3
AC × 17
WA × 3
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 1748 KiB
00_sample_01.txt AC 1 ms 1608 KiB
00_sample_02.txt AC 1 ms 1712 KiB
01_random_00.txt AC 0 ms 1604 KiB
01_random_01.txt AC 1 ms 1572 KiB
01_random_02.txt AC 1 ms 1624 KiB
01_random_03.txt AC 1 ms 1568 KiB
02_random2_00.txt WA 1 ms 1660 KiB
02_random2_01.txt AC 1 ms 1712 KiB
02_random2_02.txt AC 1 ms 1652 KiB
02_random2_03.txt AC 1 ms 1712 KiB
02_random2_04.txt AC 1 ms 1728 KiB
02_random2_05.txt AC 1 ms 1724 KiB
02_random2_06.txt AC 1 ms 1632 KiB
02_random2_07.txt AC 1 ms 1716 KiB
03_handmade_00.txt WA 1 ms 1632 KiB
03_handmade_01.txt WA 1 ms 1616 KiB
03_handmade_02.txt AC 1 ms 1620 KiB
03_handmade_03.txt AC 1 ms 1616 KiB
03_handmade_04.txt AC 1 ms 1580 KiB