Submission #36966204
Source Code Expand
#include <stdio.h>
// #include <string.h>
int main(void){
int n;
scanf("%d", &n);
int s[n];
for(int i = 0; i < n; i++){
scanf("%d", &s[i]);
}
int a[n];
a[0] = s[0];
for(int i = 1; i < n; i++){
a[i] = s[i] - s[i-1];
}
for(int i = 0; i < n; i++){
printf("%d ", a[i]);
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Inverse Prefix Sum |
| User | Cebu |
| Language | C (GCC 9.2.1) |
| Score | 200 |
| Code Size | 322 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 1728 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
6 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
./Main.c:9:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
9 | scanf("%d", &s[i]);
| ^~~~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt |
| All | min.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| min.txt | AC | 4 ms | 1672 KiB |
| random_01.txt | AC | 2 ms | 1652 KiB |
| random_02.txt | AC | 1 ms | 1676 KiB |
| random_03.txt | AC | 1 ms | 1660 KiB |
| random_04.txt | AC | 1 ms | 1728 KiB |
| random_05.txt | AC | 1 ms | 1644 KiB |
| random_06.txt | AC | 2 ms | 1656 KiB |
| random_07.txt | AC | 1 ms | 1672 KiB |
| random_08.txt | AC | 1 ms | 1664 KiB |
| random_09.txt | AC | 1 ms | 1636 KiB |
| random_10.txt | AC | 1 ms | 1624 KiB |
| sample_01.txt | AC | 1 ms | 1704 KiB |
| sample_02.txt | AC | 1 ms | 1672 KiB |