Submission #3525231


Source Code Expand

Copy
from collections import deque

N = int(input())
A = [int(i) for i in input().split()]

B = deque(maxlen=2*10**5)

if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(N):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])

print(*B)

Submission Info

Submission Time
Task C - pushpush
User temp176
Language Python3 (3.4.3)
Score 300
Code Size 401 Byte
Status
Exec Time 219 ms
Memory 25412 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 203 ms 25408 KB
even_1.txt 205 ms 25412 KB
even_2.txt 205 ms 25412 KB
even_3.txt 209 ms 25412 KB
odd_0.txt 219 ms 25412 KB
odd_1.txt 205 ms 25412 KB
odd_2.txt 203 ms 25408 KB
odd_3.txt 208 ms 25412 KB
sample1.txt 20 ms 3316 KB
sample2.txt 20 ms 3316 KB
sample3.txt 20 ms 3316 KB
sample4.txt 20 ms 3316 KB