Submission #2669648


Source Code Expand

#include<stdio.h>

int main(){
  int i,n,j;
  long a[200000],b[200000];
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%ld",&a[i]);
  j=0;
  for(i=n-1;i>=0;i--){
    if(j%2==0){
      b[j/2]=a[i];
    }
    else{
      b[n-1-(j/2)]=a[i];
    }
    j++;
  }
  for(i=0;i<n;i++)
    printf("%ld ",b[i]);
  printf("\n");
}

Submission Info

Submission Time
Task C - pushpush
User AC961009
Language C (GCC 5.4.1)
Score 300
Code Size 340 Byte
Status AC
Exec Time 43 ms
Memory 5248 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:6:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&n);
   ^
./Main.c:8:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%ld",&a[i]);
     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 12
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt, sample4.txt
All even_0.txt, even_1.txt, even_2.txt, even_3.txt, odd_0.txt, odd_1.txt, odd_2.txt, odd_3.txt, sample1.txt, sample2.txt, sample3.txt, sample4.txt
Case Name Status Exec Time Memory
even_0.txt AC 43 ms 5248 KB
even_1.txt AC 43 ms 5248 KB
even_2.txt AC 43 ms 5248 KB
even_3.txt AC 42 ms 5248 KB
odd_0.txt AC 42 ms 5248 KB
odd_1.txt AC 42 ms 5248 KB
odd_2.txt AC 42 ms 5248 KB
odd_3.txt AC 42 ms 5248 KB
sample1.txt AC 1 ms 128 KB
sample2.txt AC 1 ms 128 KB
sample3.txt AC 1 ms 128 KB
sample4.txt AC 1 ms 2176 KB