Submission #76530636
Source Code Expand
Copy
#include <stdio.h>#include <stdlib.h>int main(void) {int N, M;int* cnt;int i;int yes1 = 1, yes2 = 1;if (scanf("%d%d", &N, &M) != 2) return 1;cnt = calloc(M, sizeof(*cnt));if (cnt == NULL) return 2;for (i = 0; i < N; i++) {int F;if (scanf("%d", &F) != 1) return 1;if (1 <= F && F <= N) cnt[F - 1]++;}for (i = 0; i < M; i++) {yes1 = yes1 && cnt[i] <= 1;yes2 = yes2 && cnt[i] >= 1;}free(cnt);puts(yes1 ? "Yes" : "No");puts(yes2 ? "Yes" : "No");return 0;}
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int N, M;
int* cnt;
int i;
int yes1 = 1, yes2 = 1;
if (scanf("%d%d", &N, &M) != 2) return 1;
cnt = calloc(M, sizeof(*cnt));
if (cnt == NULL) return 2;
for (i = 0; i < N; i++) {
int F;
if (scanf("%d", &F) != 1) return 1;
if (1 <= F && F <= N) cnt[F - 1]++;
}
for (i = 0; i < M; i++) {
yes1 = yes1 && cnt[i] <= 1;
yes2 = yes2 && cnt[i] >= 1;
}
free(cnt);
puts(yes1 ? "Yes" : "No");
puts(yes2 ? "Yes" : "No");
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Mapping |
| User | mikecat |
| Language | C23 (GCC 14.2.0) |
| Score | 0 |
| Code Size | 526 Byte |
| Status | WA |
| Exec Time | 1 ms |
| Memory | 1668 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 200 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_1_00.txt, 01_random_1_01.txt, 01_random_1_02.txt, 02_random_2_00.txt, 02_random_2_01.txt, 02_random_2_02.txt, 03_random_3_00.txt, 03_random_3_01.txt, 03_random_3_02.txt, 04_random_4_00.txt, 04_random_4_01.txt, 04_random_4_02.txt, 04_random_4_03.txt, 04_random_4_04.txt, 04_random_4_05.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 0 ms | 1596 KiB |
| 00_sample_01.txt | AC | 0 ms | 1552 KiB |
| 00_sample_02.txt | AC | 0 ms | 1564 KiB |
| 00_sample_03.txt | AC | 0 ms | 1488 KiB |
| 01_random_1_00.txt | AC | 0 ms | 1484 KiB |
| 01_random_1_01.txt | AC | 0 ms | 1596 KiB |
| 01_random_1_02.txt | AC | 0 ms | 1656 KiB |
| 02_random_2_00.txt | AC | 0 ms | 1484 KiB |
| 02_random_2_01.txt | AC | 0 ms | 1656 KiB |
| 02_random_2_02.txt | AC | 0 ms | 1660 KiB |
| 03_random_3_00.txt | AC | 0 ms | 1596 KiB |
| 03_random_3_01.txt | AC | 0 ms | 1660 KiB |
| 03_random_3_02.txt | AC | 0 ms | 1564 KiB |
| 04_random_4_00.txt | AC | 1 ms | 1620 KiB |
| 04_random_4_01.txt | AC | 0 ms | 1656 KiB |
| 04_random_4_02.txt | AC | 0 ms | 1656 KiB |
| 04_random_4_03.txt | AC | 0 ms | 1564 KiB |
| 04_random_4_04.txt | WA | 0 ms | 1668 KiB |
| 04_random_4_05.txt | AC | 0 ms | 1556 KiB |