Submission #66375337
Source Code Expand
Copy
#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--) {
#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;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Not All |
| User | mikecat |
| Language | C (gcc 12.2.0) |
| Score | 200 |
| Code Size | 470 Byte |
| Status | AC |
| Exec Time | 0 ms |
| Memory | 1740 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 0 ms | 1728 KiB |
| 00_sample_01.txt | AC | 0 ms | 1664 KiB |
| 00_sample_02.txt | AC | 0 ms | 1728 KiB |
| 01_random_00.txt | AC | 0 ms | 1596 KiB |
| 01_random_01.txt | AC | 0 ms | 1660 KiB |
| 01_random_02.txt | AC | 0 ms | 1508 KiB |
| 01_random_03.txt | AC | 0 ms | 1668 KiB |
| 02_random2_00.txt | AC | 0 ms | 1724 KiB |
| 02_random2_01.txt | AC | 0 ms | 1588 KiB |
| 02_random2_02.txt | AC | 0 ms | 1732 KiB |
| 02_random2_03.txt | AC | 0 ms | 1620 KiB |
| 02_random2_04.txt | AC | 0 ms | 1732 KiB |
| 02_random2_05.txt | AC | 0 ms | 1740 KiB |
| 02_random2_06.txt | AC | 0 ms | 1660 KiB |
| 02_random2_07.txt | AC | 0 ms | 1616 KiB |
| 03_handmade_00.txt | AC | 0 ms | 1736 KiB |
| 03_handmade_01.txt | AC | 0 ms | 1728 KiB |
| 03_handmade_02.txt | AC | 0 ms | 1576 KiB |
| 03_handmade_03.txt | AC | 0 ms | 1724 KiB |
| 03_handmade_04.txt | AC | 0 ms | 1624 KiB |