Submission #2693896
Source Code Expand
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll M = 1e9 + 7; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, a; cin >> n; deque<int> q; for (int i = 0; i < n; ++i) { cin >> a; if ((i % 2) ^ (n % 2)) { q.push_front(a); } else { q.push_back(a); } } for (int i : q) { cout << i << ' '; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - pushpush |
User | meatrow |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 574 Byte |
Status | AC |
Exec Time | 38 ms |
Memory | 3072 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 | 38 ms | 3072 KB |
even_1.txt | AC | 38 ms | 3072 KB |
even_2.txt | AC | 38 ms | 3072 KB |
even_3.txt | AC | 38 ms | 3072 KB |
odd_0.txt | AC | 38 ms | 3072 KB |
odd_1.txt | AC | 38 ms | 3072 KB |
odd_2.txt | AC | 38 ms | 3072 KB |
odd_3.txt | AC | 38 ms | 3072 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 |