Submission #37493243
Source Code Expand
#include <stdio.h>
int main(void){
int n;
scanf("%d", &n);
int a[n];
for(int i = 0; i < n; i++){
scanf("%d", &a[i]);
}
int q;
scanf("%d", &q);
int query, k, x;
for(int i = 0; i < q; i++){
scanf("%d", &query);
if(query == 1){
scanf("%d %d", &k, &x);
a[k-1] = x;
}
else if(query == 2){
scanf("%d", &k);
printf("%d\n", a[k-1]);
}
}
return 0;
}
Submission Info
| Submission Time |
|
| Task |
B - First Query Problem |
| User |
Cebu |
| Language |
C (GCC 9.2.1) |
| Score |
200 |
| Code Size |
404 Byte |
| Status |
AC |
| Exec Time |
49 ms |
| Memory |
2072 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:5:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
5 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
./Main.c:8:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
8 | scanf("%d", &a[i]);
| ^~~~~~~~~~~~~~~~~~
./Main.c:12:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
12 | scanf("%d", &q);
| ^~~~~~~~~~~~~~~
./Main.c:15:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
15 | scanf("%d", &query);
| ^~~~~~~~~~~~~~~~~~~
./Main.c:17:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
17 | scanf("%d %d", &k, &x);
| ^~~~~~~~~~~~~~~~~~~~~~
./Main.c:21:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
21 | scanf("%d", &k);
| ^~~~~~~~~~~~~~~
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_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
4 ms |
1676 KiB |
| 00_sample_01.txt |
AC |
2 ms |
1708 KiB |
| 00_sample_02.txt |
AC |
1 ms |
1716 KiB |
| 01_random_03.txt |
AC |
37 ms |
1652 KiB |
| 01_random_04.txt |
AC |
47 ms |
2040 KiB |
| 01_random_05.txt |
AC |
45 ms |
2072 KiB |
| 01_random_06.txt |
AC |
18 ms |
1924 KiB |
| 01_random_07.txt |
AC |
45 ms |
2060 KiB |
| 01_random_08.txt |
AC |
49 ms |
2040 KiB |
| 01_random_09.txt |
AC |
45 ms |
2036 KiB |
| 01_random_10.txt |
AC |
46 ms |
2016 KiB |