Submission #73503249
Source Code Expand
#include<stdio.h>
int main(void) {
int N, M;
scanf("%d%d", &N, &M);
int L[M];
int X[N][M];
for(int i=0; i<N; i++) {
scanf("%d", &L[i]);
for(int j=0; j<L[i]; j++) {
scanf("%d", &X[i][j]);
}
}
int stock[M];
for(int i=0; i<M; i++) {
stock[i] = i+1;
}
int i=0, j=0, k=0;
while(i<N) {
for(j=0; j<L[i]; j++) {
for(k=0; k<M; k++) {
if(X[i][j] == stock[k]) {
printf("%d\n", k + 1);
stock[k] = 0;
i++;
break;
}
}
}
if(k!=M-1){
printf("0\n");
}
i++;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Greedy Draft |
| User | null_beta |
| Language | C23 (GCC 14.2.0) |
| Score | 0 |
| Code Size | 764 Byte |
| Status | RE |
| Exec Time | 87 ms |
| Memory | 1784 KiB |
Compile Error
Main.c: In function ‘main’:
Main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d%d", &N, &M);
| ^~~~~~~~~~~~~~~~~~~~~
Main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d", &L[i]);
| ^~~~~~~~~~~~~~~~~~
Main.c:12:13: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d", &X[i][j]);
| ^~~~~~~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 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 | WA | 0 ms | 1600 KiB |
| 00-sample-02.txt | AC | 0 ms | 1628 KiB |
| 01-01.txt | WA | 0 ms | 1612 KiB |
| 01-02.txt | WA | 0 ms | 1540 KiB |
| 01-03.txt | WA | 0 ms | 1668 KiB |
| 01-04.txt | WA | 0 ms | 1604 KiB |
| 01-05.txt | RE | 87 ms | 1600 KiB |
| 01-06.txt | WA | 1 ms | 1648 KiB |
| 01-07.txt | RE | 84 ms | 1500 KiB |
| 01-08.txt | WA | 1 ms | 1648 KiB |
| 01-09.txt | RE | 83 ms | 1544 KiB |
| 01-10.txt | RE | 85 ms | 1456 KiB |
| 01-11.txt | RE | 82 ms | 1464 KiB |
| 01-12.txt | RE | 82 ms | 1648 KiB |
| 01-13.txt | WA | 1 ms | 1784 KiB |
| 01-14.txt | RE | 83 ms | 1620 KiB |
| 01-15.txt | WA | 1 ms | 1752 KiB |
| 01-16.txt | WA | 0 ms | 1676 KiB |
| 01-17.txt | WA | 0 ms | 1608 KiB |
| 01-18.txt | WA | 0 ms | 1600 KiB |