Submission #3027365


Source Code Expand

#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<vector>
using namespace std;

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//infinity
#define INTINF 2000000000
#define LONGINF 2000000000

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
	int n; cin >> n;
	int a[n];
	REP(i, n) cin >> a[i];

	for(int i = n-1; i >= 0; i-=2){
		if(i==n-1){
			cout << a[i];
		}else{
			cout << " " << a[i];
		}
	}

	for(int i = n%2; i < n; i+=2){
		cout << " " << a[i];
	}

	cout << endl;
	return 0;
}

Submission Info

Submission Time
Task C - pushpush
User kontotto
Language C++14 (GCC 5.4.1)
Score 300
Code Size 723 Byte
Status AC
Exec Time 126 ms
Memory 2944 KB

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 124 ms 2944 KB
even_1.txt AC 124 ms 2944 KB
even_2.txt AC 125 ms 2944 KB
even_3.txt AC 124 ms 2944 KB
odd_0.txt AC 124 ms 2944 KB
odd_1.txt AC 126 ms 2944 KB
odd_2.txt AC 124 ms 2944 KB
odd_3.txt AC 126 ms 2944 KB
sample1.txt AC 1 ms 256 KB
sample2.txt AC 1 ms 256 KB
sample3.txt AC 1 ms 256 KB
sample4.txt AC 1 ms 256 KB