Submission #41201938
Source Code Expand
#include<stdio.h>
int a[110];
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%d",a+i);
for(int i=0;i<n-1;i++){
if(a[i]<a[i+1]){
for(int x=a[i];x<a[i+1];x++)printf("%d ",x);
}else{
for(int x=a[i];x>a[i+1];x--)printf("%d ",x);
}
}
printf("%d\n",a[n-1]);
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Fill the Gaps |
| User | kyopro_friends |
| Language | C (GCC 9.2.1) |
| Score | 200 |
| Code Size | 304 Byte |
| Status | AC |
| Exec Time | 6 ms |
| Memory | 1700 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:7:22: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
7 | for(int i=0;i<n;i++)scanf("%d",a+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 | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, sample_01.txt, sample_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | AC | 6 ms | 1700 KiB |
| random_02.txt | AC | 1 ms | 1624 KiB |
| random_03.txt | AC | 1 ms | 1596 KiB |
| random_04.txt | AC | 1 ms | 1676 KiB |
| random_05.txt | AC | 1 ms | 1672 KiB |
| random_06.txt | AC | 3 ms | 1628 KiB |
| random_07.txt | AC | 1 ms | 1600 KiB |
| random_08.txt | AC | 1 ms | 1604 KiB |
| sample_01.txt | AC | 1 ms | 1628 KiB |
| sample_02.txt | AC | 1 ms | 1604 KiB |