Submission #76860825
Source Code Expand
Copy
#include <stdio.h>#include <stdlib.h>int main(void) {int N, *A, X;int i;if (scanf("%d", &N) != 1) return 1;A = malloc(sizeof(*A) * N);if (A == NULL) return 2;for (i = 0; i < N; i++) {if (scanf("%d", &A[i]) != 1) return 1;}if (scanf("%d", &X) != 1) return 1;printf("%d\n", A[X - 1]);free(A);return 0;}
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int N, *A, X;
int i;
if (scanf("%d", &N) != 1) return 1;
A = malloc(sizeof(*A) * N);
if (A == NULL) return 2;
for (i = 0; i < N; i++) {
if (scanf("%d", &A[i]) != 1) return 1;
}
if (scanf("%d", &X) != 1) return 1;
printf("%d\n", A[X - 1]);
free(A);
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Array |
| User | mikecat |
| Language | C23 (GCC 14.2.0) |
| Score | 100 |
| Code Size | 347 Byte |
| Status | AC |
| Exec Time | 0 ms |
| Memory | 1624 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| 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, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 0 ms | 1488 KiB |
| 00_sample_01.txt | AC | 0 ms | 1624 KiB |
| 00_sample_02.txt | AC | 0 ms | 1484 KiB |
| 01_random_00.txt | AC | 0 ms | 1564 KiB |
| 01_random_01.txt | AC | 0 ms | 1596 KiB |
| 01_random_02.txt | AC | 0 ms | 1488 KiB |
| 01_random_03.txt | AC | 0 ms | 1596 KiB |
| 01_random_04.txt | AC | 0 ms | 1568 KiB |
| 01_random_05.txt | AC | 0 ms | 1576 KiB |
| 01_random_06.txt | AC | 0 ms | 1588 KiB |