Submission #8076685


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define countof(a) (sizeof(a)/sizeof((a)[0]))
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_v(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << endl; }
template<class T> void cout_h(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << (i==c.size()-1?"\n":" "); }
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}
void Yes(bool f){cout<<(f?"Yes":"No")<<endl;}
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 

int main()
{
    cin.tie(0); ios::sync_with_stdio(false);
    //cout<<std::fixed<<std::setprecision(10);

    int n; cin >>n;
    vector<int> a(n); cin >> a;

    for (int i=n-1; i >= 0; i-=2) {
        cout << a[i] << (n==1?"\n":" ");
    }
    int last = n%2+(n/2-1)*2;
    for (int i = n%2; i < n; i+=2) {
        cout << a[i] << (i==last?"\n":" ");
    }   
}

Submission Info

Submission Time
Task C - pushpush
User minokasago
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1442 Byte
Status
Exec Time 38 ms
Memory 2944 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt, sample3.txt, sample4.txt
All 300 / 300 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 38 ms 2944 KB
even_1.txt 38 ms 2944 KB
even_2.txt 38 ms 2944 KB
even_3.txt 38 ms 2944 KB
odd_0.txt 38 ms 2944 KB
odd_1.txt 38 ms 2944 KB
odd_2.txt 38 ms 2944 KB
odd_3.txt 38 ms 2944 KB
sample1.txt 1 ms 256 KB
sample2.txt 1 ms 256 KB
sample3.txt 1 ms 256 KB
sample4.txt 1 ms 256 KB