Submission #1871290
Source Code Expand
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 5; int n, a[N], pos[N], p[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for (int i = 1; i <= n; ++i) cin >> a[i]; for (int i = 1; i <= n; ++i) { if (i % 2 == (n + 1) % 2) { pos[i] = ((n + 1) - i) / 2 + i; } else { pos[i] = ((n + 1) - (i - 1)) / 2; } } for (int i = 1; i <= n; ++i) p[pos[i]] = a[i]; for (int i = 1; i <= n; ++i) printf("%d ", p[i]); printf("\n"); }
Submission Info
Submission Time | |
---|---|
Task | C - pushpush |
User | cheater2k |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 499 Byte |
Status | AC |
Exec Time | 41 ms |
Memory | 4480 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 | 40 ms | 4480 KB |
even_1.txt | AC | 40 ms | 4480 KB |
even_2.txt | AC | 40 ms | 4480 KB |
even_3.txt | AC | 40 ms | 4480 KB |
odd_0.txt | AC | 40 ms | 4480 KB |
odd_1.txt | AC | 40 ms | 4480 KB |
odd_2.txt | AC | 41 ms | 4480 KB |
odd_3.txt | AC | 40 ms | 4480 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 |