Submission #3766062


Source Code Expand

#include "bits/stdc++.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <math.h>
#include <algorithm>
#include <queue>
#include <set>
#include <tuple>
using namespace std;

#define FOR(i,init,a) for(int i=init; i<a; i++)
#define rep(i,a) FOR(i,0,a)
#define rrep(i,a) for(int i=a; i>=0; i--)
#define rep1(i,a) for(int i=1; i<=a; i++)
#define cout1(a) cout << a << endl;
#define cout2(a,b) cout << a << " " << b << endl;
#define cout3(a,b,c) cout << a << " " << b << " " << c << endl;
#define cout4(a,b,c,d) cout << a << " " << b << " " << c << " " << d << endl;
#define mem(a,n) memset( a, n, sizeof(a))
#define all(a) a.begin(),a.end()
#define chmin(a,b) a=min(a,b);
#define chmax(a,b) a=max(a,b);

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;
static const double pi = 3.141592653589793;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N;
    cin>>N;
    
    vector<int> nums;
    rep(i,N){
        int x;cin>>x;
        if(i%2){
            nums.insert(nums.begin(),x);
        }else{
            nums.push_back(x);
        }
    }
    
    if(N%2) reverse(all(nums));
    rep(i,N){
        if(i)cout<<" ";
        cout<<nums[i];
    }
    cout<<endl;
}

Submission Info

Submission Time
Task C - pushpush
User mensan_fukuhara
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1461 Byte
Status AC
Exec Time 1508 ms
Memory 3060 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 1503 ms 3060 KB
even_1.txt AC 1508 ms 3060 KB
even_2.txt AC 1504 ms 3060 KB
even_3.txt AC 1504 ms 3060 KB
odd_0.txt AC 1504 ms 3060 KB
odd_1.txt AC 1505 ms 3060 KB
odd_2.txt AC 1505 ms 3060 KB
odd_3.txt AC 1505 ms 3060 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