Submission #75560736
Source Code Expand
Copy
#include <stdio.h>#define MAX_N 4096#define MAX_M 4096int N, M;int L[MAX_N];int X[MAX_N][MAX_M];char used[MAX_M];int main(void) {int i, j;if (scanf("%d%d", &N, &M) != 2) return 1;for (i = 0; i < N; i++) {if (scanf("%d", &L[i]) != 1) return 1;for (j = 0; j < L[i]; j++) {if (scanf("%d", &X[i][j]) != 1) return 1;}}for (i = 0; i < N; i++) {int ans = 0;for (j = 0; j < L[i]; j++) {if (!used[X[i][j]]) {ans = X[i][j];used[X[i][j]] = 1;break;}}printf("%d\n", ans);}return 0;}
#include <stdio.h>
#define MAX_N 4096
#define MAX_M 4096
int N, M;
int L[MAX_N];
int X[MAX_N][MAX_M];
char used[MAX_M];
int main(void) {
int i, j;
if (scanf("%d%d", &N, &M) != 2) return 1;
for (i = 0; i < N; i++) {
if (scanf("%d", &L[i]) != 1) return 1;
for (j = 0; j < L[i]; j++) {
if (scanf("%d", &X[i][j]) != 1) return 1;
}
}
for (i = 0; i < N; i++) {
int ans = 0;
for (j = 0; j < L[i]; j++) {
if (!used[X[i][j]]) {
ans = X[i][j];
used[X[i][j]] = 1;
break;
}
}
printf("%d\n", ans);
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Greedy Draft |
| User | mikecat |
| Language | C23 (GCC 14.2.0) |
| Score | 200 |
| Code Size | 578 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 2172 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 0 ms | 1728 KiB |
| 00-sample-02.txt | AC | 0 ms | 1784 KiB |
| 01-01.txt | AC | 0 ms | 1580 KiB |
| 01-02.txt | AC | 0 ms | 1660 KiB |
| 01-03.txt | AC | 1 ms | 1856 KiB |
| 01-04.txt | AC | 1 ms | 1672 KiB |
| 01-05.txt | AC | 1 ms | 1984 KiB |
| 01-06.txt | AC | 1 ms | 2048 KiB |
| 01-07.txt | AC | 1 ms | 2092 KiB |
| 01-08.txt | AC | 1 ms | 1928 KiB |
| 01-09.txt | AC | 1 ms | 1968 KiB |
| 01-10.txt | AC | 1 ms | 2104 KiB |
| 01-11.txt | AC | 1 ms | 2168 KiB |
| 01-12.txt | AC | 1 ms | 2080 KiB |
| 01-13.txt | AC | 1 ms | 2096 KiB |
| 01-14.txt | AC | 1 ms | 2172 KiB |
| 01-15.txt | AC | 1 ms | 2112 KiB |
| 01-16.txt | AC | 0 ms | 1720 KiB |
| 01-17.txt | AC | 0 ms | 1728 KiB |
| 01-18.txt | AC | 0 ms | 1696 KiB |