Submission #2710755


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

const int HUGEI = 2147483647;  // (1 << 31) - 1
const long long HUGEL = 9223372036854775807;  // (1 << 63) - 1
const string ABC = "abcdefghijklmnopqrstuvwxyz";

int main(void) {
    int n;
    vector <int> an;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        an.push_back(a);
    }
    deque <int> bn;
    for (int i = 0; i < n; i++) {
        if ((n - (i + 1)) % 2 == 0) {
            bn.push_front(an[i]);
        } else {
            bn.push_back(an[i]);
        }
    }
    for (int i = 0; i < n; i++) {
        cout << bn[i];
        if (i < n - 1) {
            cout << " ";
        }
    }
    cout << endl;
    return 0;
}

Submission Info

Submission Time
Task C - pushpush
User sen_7
Language C++14 (GCC 5.4.1)
Score 300
Code Size 719 Byte
Status AC
Exec Time 105 ms
Memory 3828 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 105 ms 3828 KB
even_1.txt AC 99 ms 3828 KB
even_2.txt AC 99 ms 3828 KB
even_3.txt AC 100 ms 3828 KB
odd_0.txt AC 99 ms 3828 KB
odd_1.txt AC 100 ms 3828 KB
odd_2.txt AC 100 ms 3828 KB
odd_3.txt AC 99 ms 3828 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