Problem:


Score : 300 points

Problem Statement

You are given an integer sequence of length n, a_1, ..., a_n.
Let us consider performing the following n operations on an empty sequence b.

The i-th operation is as follows:

Append a_i to the end of b.

Reverse the order of the elements in b.

Find the sequence b obtained after these n operations.

Constraints

1 \leq n \leq 2\times 10^5

0 \leq a_i \leq 10^9

n and a_i are integers.

Input

Input is given from Standard Input in the following format:

n
a_1 a_2 ... a_n

Output

Print n integers in a line with spaces in between.
The i-th integer should be b_i.

Sample Input 1

4
1 2 3 4

Sample Output 1

4 2 1 3

After step 1 of the first operation, b becomes: 1.

After step 2 of the first operation, b becomes: 1.

After step 1 of the second operation, b becomes: 1, 2.

After step 2 of the second operation, b becomes: 2, 1.

After step 1 of the third operation, b becomes: 2, 1, 3.

After step 2 of the third operation, b becomes: 3, 1, 2.

After step 1 of the fourth operation, b becomes: 3, 1, 2, 4.

After step 2 of the fourth operation, b becomes: 4, 2, 1, 3.

Thus, the answer is 4 2 1 3.

Sample Input 2

3
1 2 3

Sample Output 2

3 1 2

As shown above in Sample Output 1, b becomes 3, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.

Sample Input 3

1
1000000000

Sample Output 3

1000000000

Sample Input 4

6
0 6 7 6 7 0

Sample Output 4

0 6 6 0 7 7



Sample input:
4
1 2 3 4


Sample output:
4 2 1 3

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())
a = list(map(int, input().split()))
b = deque()
for i in range(n):
    if i % 2 != 0:
        b.appendleft(a[i])
    else:
        b.append(a[i])

print(*list(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    if i % 2 != 0:
        b.insert(0, a[i])
    else:
        b.append(a[i])

print(*list(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    if i % 2 != 0:
        b.insert(0, a[i])
    else:
        b.append(a[i])

print(' '.join(map(str, b)))

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())
a = list(map(int, input().split()))

b = deque()
for i in range(n):
    if i % 2 == 0 and n % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])


print(*list(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
num = 1
for x in a:
  if num%2 == 1:
    b.append(x)
  else:
    b.insert(0,x)
  num += 1
print(*b)

Submission status: Wrong Answer

Solution code:
def q(l):
	a=''
	for i in range(len(l)):
		a = a+l[i]
		a = a[::-1]
		
	return a

	
			
n=int(input())
a=list(input().split())

ans = q(a)

print(' '.join(ans))

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = deque(map(int, input().split()))
b = deque()

for i in range(n):
    if i % 2 == 0:
        b.append(a.popleft())
    else:
        b.appendleft(a.popleft())

print(*b)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))

front=[]
end=[]

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

front.reverse()
data=front+end
if N%2==0:
    data.reverse()
data=list(map(str,data))
print(" ".join(data))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))

front=[]
end=[]

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

front.reverse()
data=front+end
if N%2==0:
    data.reverse()
data=list(map(str,data))
print(" ".join(data))

Submission status: Wrong Answer

Solution code:

N = int(input())
A = list(map(int, input().split()))

B = [0] * N
if N % 2 == 0:
  for i in range(N):
    if i % 2 == 0:
      print(i, A[i], i//2, N//2+i//2)
      B[N//2+i//2] = A[i]
    else:
      print(i, A[i], i//2, N//2-(i//2+1))
      B[N//2-(i//2+1)] = A[i]
else:
  for i in range(N):
    if i % 2 == 1:
      B[N//2+(i//2+1)] = A[i]
    else:
      B[N//2-(i//2)] = A[i]

print(*B)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(str,input().split()))
b = []
for i in range(n):
    if i%2 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])
ans = " ".join(b)
if n%2 == 0:
    print(ans)
else:
    print(ans[::-1])

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	ans = []
	for i in reversed(range(n%2+1,n+1,2)):
		ans.append(a[i])
	for i in range(0,n-1,2):
		ans.append(a[i])
	for i in ans:
		print(i,end=' ')
	print()

main()

Submission status: Wrong Answer

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	ans = []
	for i in reversed(range(n%2+1,n+1,2)):
		ans.append(a[i])
	for i in range(0,n-1,2):
		ans.append(a[i])
	print(ans)

main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
a = [int(x) for x in input().split()]

b = []
for ai in a:
    b.append(ai)
    b = b[::-1]
print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

L = []
for a in A:
    L.append(a)
    L.reverse()    
print(L)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
A=list(map(int, input().split()))

ans = [0] * n
if (n % 2 == 0):
    for i in range(n):
        if (i%2 == 0):
            ans[n//2+i//2] = A[i]
        else:
            ans[n//2-(i+2)//2] = A[i]
if (n % 2 != 0):
    for i in range(n):
        if (i%2 == 0):
            ans[n//2-i//2] = A[i]
        else:
            ans[n//2+(i+2)//2] = A[i]

print(ans)

Submission status: Wrong Answer

Solution code:

n = int(input())
input_list = list(map(int, input().split()))
q = []

for i in input_list:
    if i % 2 == 1:
        q.append(i)
    else:
        q.insert(0, i)

print(' '.join(map(str, q)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(_) for _ in input().split()]

odd = []
even = []
for n in range(N):
    if n % 2 == 0:
        even.append(A[n])
    if n % 2 == 1:
        odd.append(A[n])

oppodd = odd[::-1]
oppeven = even[::-1]
#print(*oppeven)
#print(*oppodd)
if N % 2 != 0:
    B = oppeven + oppodd
    print(*B)
else:
    B = oppodd + even
    print(*B)
#n-1番目は1番目にくる
#n-2番目はn-1番目にくる
#n-3番目は2番目
#n-4番目は3

Submission status: Wrong Answer

Solution code:
n = int(input())
al = list(map(int,input().split()))

for a in list(reversed(al[1::2])) + al[0::2]:
    print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = [i for i in map(str,input().split())]
length = len(A)
ans = []
if length%2 != 0:
  A.insert(0,str(-1))

while A:
  ans.append(A.pop(0))
  if not A: break
  ans.insert(0,A.pop(0))

if length%2 != 0:
  ans.remove(str(-1))
  print(ans)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))
ans=[]
a=''
for i in range(0,n):
    if i%2==0:
        ans.append(A[i])
    if i%2==1:
        ans.insert(0,A[i])
if n%2==1:
    ans.sort(reverse=True)
print(" ".join(map(str, ans)))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []

for i in range(n):
    if i % 2 == 0:
        b.insert(0, a[i])
    else:
        b.append(a[i])

if n % 2 == 0:
    c = b[::-1]
    for i in range(len(b)):
        print(i, end=' ')

else:
    for i in range(len(b)):
        print(i, end=' ')

Submission status: Wrong Answer

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


n = int(input())
a = list(input().split())

memo = a[0]
for i in range(1,n):
    if i%2==0:
        memo = memo + a[i]
    else:
        memo = a[i] + memo

memo = list(memo)

if n%2 == 0:
    print(*memo)
else:
    for i in range(1,n+1):
        print(memo[-i],"",end="")
    print()

Submission status: Wrong Answer

Solution code:
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


n = int(input())
a = list(input())

memo = ''
for i in range(n):
    if i%2==0:
        memo = memo + a[i]
    else:
        memo = a[i] + memo
    
print(*list(memo))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    print(*A_oddList , end = " ")
    print(*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , end = " ")
    print(*A_oddList)

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = list(map(int,input().split()))

b = deque()

for i in range(n):
  if i%2 == 0:
    b.append(a[i])
  else:
    b.appendleft(a[i])
    
b = list(b)    

for i in range(n):
  print(b[i], end=" ")

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = list(map(int,input().split()))

b = deque()

for i in range(n):
  if i%2 == 0:
    b.append(a[i])
  else:
    b.appendleft(a[i])
    
for i in range(n):
  print(a[i], end=" ")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))

b = []
for i in range(n):
  if i%2 == 0:
    b += [a[i]]
  else:
    b = [a[i]] + b
    
for i in range(n):
  print(a[i], end=" ")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))

b = []
for i in range(n):
  if i%2 == 0:
    b += [str(a[i])]
  else:
    b = [str(a[i])] + b
    #print(b)

print(" ".join(b))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=a[1::2][::-1]+a[0::2]
b=(b,b[::-1])[n%2>1]
print(*b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=a[1::2][::-1]+a[0::2]
b=(b[::-1],b)[n%2>0]
print(b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=a[1::2][::-1]+a[0::2]
b=(b,b[::-1])[n%2>0]
print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

l = range(n)[::-2] 
r = range(n)[::2]

for i in l:
    b.append(str(a[i]))
for i in r:
    b.append(str(a[i]))
    
print(" ".join(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

b = []

for i in range(n):
    b.append(a[i])
    b = b[::-1]
    
print(b)

Submission status: Wrong Answer

Solution code:
from collections import deque

b = deque()
n=int(input())
a=[i for i in input().split()]
ans=0
for i in range(n):
    if(i%2==0):
        b.append(a[i])
    else:
        b.appendleft(a[i])
if(n%2==1):
    b.reverse()
print(''.join(b))

Submission status: Wrong Answer

Solution code:
from collections import deque

b = deque()
n=int(input())
a=[i for i in input().split()]
ans=0
for i in range(n):
    b.append(a[i])
    b.reverse()
print(''.join(b))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
i=n-1
for _ in range(n//2+1):
    b.append(a[i])
    i-=2
    if i<=-1:
        break
i=0
for _ in range(n//2+1):
    b.append(a[i])
    i+=2
    if i>=n-1:
        break
print(' '.join(map(str,b)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b=b[::-1]
print(b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
if n%2==0:
    for i in range(n-1,0,-2):
        b.append(a[i])
    for j in range(0,n-1,2):
        b.append(a[j])
    print(*b)
else:
    for i in range(n-1,-1,-2):
        b.append(a[i])
    for j in range(1,n-1,2):
        b.append(a[i])
    print(*b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
if n%2==0:
    for i in range(n-1,0,-2):
        b.append(a[i])
    for j in range(0,n-1,2):
        b.append(a[j])
    print(b)
else:
    for i in range(n-1,-1,-2):
        b.append(a[i])
    for j in range(1,n-1,2):
        b.append(a[i])
    print(*b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
if n%2==0:
    for i in range(n-1,0,-2):
        b.append(a[i])
    for j in range(0,n-1,2):
        b.append(a[j])
    print(b)
else:
    for i in range(n-1,-1,-2):
        b.append(a[i])
    for j in range(1,n-1,2):
        b.append(a[i])
    print(b)

Submission status: Wrong Answer

Solution code:
n=6
a=[0,6,7,6,7,0]
b=[]
if n%2==0:
    for i in range(n-1,0,-2):
        b.append(a[i])
    for j in range(0,n-1,2):
        b.append(a[j])
    print(b)
else:
    for i in range(n-1,-1,-2):
        b.append(a[i])
    for j in range(1,n-1,2):
        b.append(a[i])
    print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
#b = []
#for ai in a:
#  b.append(str(ai))
#  b = list(reversed(b))
#print(' '.join(b))

even = []
odd = []
for i, ai in enumerate(a):
  if (i + 1) % 2 == 0:
    even.append(str(ai))
  else:
    odd.append(str(ai))

r = list(reversed(even))
answer = r + odd
print(' '.join(answer))

Submission status: Wrong Answer

Solution code:
N = int(input())
D = list(map(int, input().split()))



res=[]


for i in range(N):
    res.append(D[i])
    res.reverse()


print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
alist = list(map(int, input().split()))
b = alist[0::2][::-1] + alist[1::2]
for _ in b[::-1]:
    print(_, end=" ")

Submission status: Wrong Answer

Solution code:
n = int(input())
alist = list(map(int, input().split()))
b = alist[0::2] + alist[1::2]
for _ in b:
    print(_, end=" ")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

odd = a[::2]
even = a[-1::-2]

for i in even + odd:
  print(i)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[int(x) for x in input().split()]
b=[]
for i in range(N):
  b +=[a[i]]
  b.reverse()
print(b)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
a=input().split()
ans=[]
'''
for i in range(n):
    if n%2==0:
        if i%2!=0:
            ans.insert(0,a[i])
        else:
            ans.append(a[i])
    else:
        if i%2==0:
            ans.insert(0,a[i])
        else:
            ans.append(a[i])
ans=' '.join(ans)
if n==1:
    ans=a[0]
'''
for j in range(n):
    ans.insert(0,a[j])
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
a=input().split()
ans=[]
'''
for i in range(n):
    if n%2==0:
        if i%2!=0:
            ans.insert(0,a[i])
        else:
            ans.append(a[i])
    else:
        if i%2==0:
            ans.insert(0,a[i])
        else:
            ans.append(a[i])
ans=' '.join(ans)
if n==1:
    ans=a[0]
'''
for j in range(n):
    ans.append(a[j])
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()

if n % 2 == 0:
    b = a[::-2] + a[::2]
else:
    b = a[::-2] + a[1::2]

print(''.join(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(elem) for elem in input().split()]
b = []
for i, elem in enumerate(a):
  if i % 2 == 1:
    b.insert(0, elem)
  else:
  	b.append(elem)
b = [str(elem) for elem in b]
ans = ' '.join(b)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

b = []
tmp = []

for i in range(N):
    if i % 2 == 0:
        b.append(A[i])
    else:
        tmp.append(A[i])
tmp.reverse()

tmp.extend(b)
print(" ".join(map(str, tmp)))

Submission status: Wrong Answer

Solution code:
N=int(input())

a = input().split()

center=a[0]


tail = ""
head = ""
if N>=2:
    tail = " ".join(a[2:][::2])
    head = " ".join(a[1:][::2])

if N==1:
    print(center)
elif N==2:
    print(" ".join(a))
elif N%2==0:
    print(head[::-1]+" "+ center +" "+tail)
else:
    print(tail[::-1]+" "+ center +" "+head)

Submission status: Wrong Answer

Solution code:
N=int(input())

a = input().split()

center=a[0]
tail = " ".join(a[2:][::2])

head = " ".join(a[1:][::2])

if N==1:
    print(center)
elif N==2:
    print(" ".join(a))
elif N%2==0:
    print(head[::-1]+" "+ center +" "+tail)
else:
    print(tail[::-1]+" "+ center +" "+head)

Submission status: Wrong Answer

Solution code:
N=int(input())

a = input().split()

center=a[0]
tail = " ".join(a[2:][::2])

head = " ".join(a[1:][::2])

if N==1:
    print(tail)
elif N==2:
    print(" ".join(a))
elif N%2==0:
    print(head[::-1]+" "+ center +" "+tail)
else:
    print(tail[::-1]+" "+ center +" "+head)

Submission status: Wrong Answer

Solution code:
N=int(input())

a = input().split()

tail = " ".join(a[::2])

head = " ".join(a[1:][::2])

if N%2==0:
    print(head[::-1]+" "+tail)
else:
    print(tail[::-1]+" "+head)

Submission status: Wrong Answer

Solution code:
N=input()

a = input().split()

tail = " ".join(a[::2])

head = " ".join(a[1:][::2])

print(head[::-1]+" "+tail)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))

Odd = []
Even = []

for i in range(n):
    if A[i]%2:
        Odd.append(A[i])
    else:
        Even.append(A[i])
        
if n%2:
    print(*(list(reversed(Odd))+Even))
else:
    print(*(list(reversed(Even))+Odd))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(str,input().split()))
b=''
for i in range(n):
    b+=a[i]
    b=b[::-1]
print(" ".join(map(str,list(b))))

Submission status: Wrong Answer

Solution code:
# C - pushpush
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    if n % 2 == 0:
        if i % 2 ==0:
            b.append(a[i])
        else:
            b.insert(0,a[i])
    else:
        if i % 2 !=0:
            b.append(a[i])
        else:
            b.insert(0,a[i])

for s in b:
    print(s, end="")

Submission status: Wrong Answer

Solution code:
from collections import deque

n=int(input())
a=list(map(int,input().split()))

b=deque()
l=len(a)
if l%2==0:
    for i in range(l):
        if i%2!=0:
            b.append(a[i])
        else:
            b.appendleft(a[i])
else:
    for i in range(l):
        if i%2!=0:
            b.appendleft(a[i])
        else:
            b.append(a[i])
print(*b)

Submission status: Wrong Answer

Solution code:
from collections import deque

n=int(input())
a=list(map(int,input().split()))

b=deque()
if len(a)%2==0:
    for i in a:
        if i%2!=0:
            b.append(i)
        else:
            b.appendleft(i)
else:
    for i in a:
        if i%2!=0:
            b.appendleft(i)
        else:
            b.append(i)
print(*b)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
b = []
for i in range(n):
    if (i + 1) % 2 == 0:
        b = [a[i]] + b
    else:
        b += [a[i]]
if n % 2 != 0:
    print(*b)
else:
    print(*b)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [str(i) for i in input().split()]
dp = [[0,0] for i in range(N+1)]

dp[0][0],dp[0][1] = A[0],A[0]
for i in range(1,N):
    dp[i][0] = dp[i-1][1]+A[i]
    dp[i][1] = dp[i][0][::-1]
ans = list(dp[N-1][1])
print(*ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
arr=input().split()
ans=arr[::2][::-1]+arr[1::2]
if N!=1:
    ans=ans[::-1]
print(*ans,sep=' ')

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(input().split())
ans=[]
for A in a:
    ans.append(A)
    ans.reverse()
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
    if (i+1) % 2:
        b = b + [a[i]]
    else:
        b = [a[i]] + b
        
print(' '.join(map(str, b)))

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())
A = list(map(int, input().split()))
even_odd = n % 2
b = deque()
for a in A:
    if a % 2 == even_odd:
        b.appendleft(a)
    else:
        b.append(a)
print(*b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(input().split())
b=[]

if n%2!=0:
    for i in range(n):
        if i%2!=0:
            b.insert(0,a[i])
        else:
            b.append(a[i])
else:
    for i in range(n):
        if i%2==0:
            b.insert(0,a[i])
        else:
            b.append(a[i])
print(" ".join(b))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))

b=''
for i in range(n):
  if i%2==n%2:
    b=b+str(A[i])
  else:
    b=str(A[i])+b
b=list(b)
print(*b)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input().replace(" ","")
if n == 1:
    print(s)
    exit()
if n % 2 == 0:
    s = s[::-2]+s[0::2]
else: s = s[::-2]+s[1::2]
print(*[i for i in s],sep=" ")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().replace(" ","")
s = ""
for i in a:
    s += i
    s = s[::-1]
print(*[i for i in s],sep=" ")

Submission status: Wrong Answer

Solution code:
from collections import deque

N = int(input())
A = [int(a) for a in input().split()]
B = deque([])
for n in range(N):
    if n % 2 == 0:
        B.append(A[n])
    else:
        B.appendleft(A[n])
print(*B)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
B1 = []
B2 = []
for n in range(N):
    if n % 2 == 0:
        B1.append(A[n])
    else:
        B2.insert(0, A[n])
        
print(*(B2+B1))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
b = []
for i in range(n):
	if i%2 == 0:
		b.append(A[i])
	else:
		b.insert(0, A[i])
print(*b)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = input().split()
B = []
for i,a in enumerate(A):
    if i%2==0:
        B.insert(0,a)
    else:
        B.append(a)
print(B.pop(0),end='')
for b in B:
    print(' '+b,end='')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans_l = []

for i in range(n):
    if i % 2 == 1:
        tmp_l = [a[i]]
        ans_l = tmp_l + ans_l
    else:
        ans_l.append(a[i])
        
print(*ans_l)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans_l = []

for i in range(n):
    if i % 2 == 1:
        ans_l.insert(0,a[i])
    else:
        ans_l.append(a[i])
        
print(ans_l)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
B1, B2 = [], []

if N % 2 == 1:
  for idx in range(0,N,2):
    B1.append(A[N-idx-1])
  for idx in range(1,N,2):
    B2.append(A[idx])
else:
  for idx in range(0,N,2):
    B2.append(A[idx])
  for idx in range(1,N,2):
    B1.append(A[N-idx])
print(''.join(map(str,B1+B2)))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = input().split()
b = ""
for a in A:
  b += a
  b = b[::-1]
print(b)

Submission status: Wrong Answer

Solution code:




def main():

    N = int(input())
    aList = list(map(int,input().split()))
    bList = []
    for i in aList:
        bList.append(i)
        bList.reverse()
    print(bList)

 





if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a= list(map(int,input().split()))
if n%2 ==1:
    ans = a[::-2]+a[1::2]
else:
    ans = a[::-2]+a[0::2]
print(*a)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = []
if n % 2 == 0:
    for i in a:
        if i % 2 ==0:
            ans.insert(0,i)
        else:
            ans.append(i)
else:
    for i in a:
        if i % 2 ==0:
            ans.append(i)
        else:
            ans.insert(0,i)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  elif i%2==1:
    b.insert(0,a[i])
print(*b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if i==0:
    b.append(a[0])
  elif i%2==1:
    b.insert(0,a[i])
  elif i%2==0:
    b.append(a[i])
print(*b)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

right = []
left = []
for i in range(N):
    if i % 2 == 0:
        right.append(A[i])
    else:
        left.append(A[i])
answer = left[::-1]
answer += right
print(*answer)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
for i,x in enumerate(map(int,input().split())):
    if i%2: l.insert(0,x)
    else: l.append(x)
print(*l)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
for i,x in enumerate(map(int,input().split())):
    if i%2: l.insert(0,x)
    else: l.append(x)
print(l)

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())
A = list(map(int,input().split()))
l = deque()
for i in range(len(A)):
  if i % 2 == 0:
    l.append(A[i])
  else:
    l.appendleft(A[i])
print(*l)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

b = []

for i in range((n+1)//2):
    #print(i)
    b.append(a[n-1-2*i])

for i in range(n//2):
    b.append(a[2*i])

print(*b)

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc066/tasks/arc077_a
# C - pushpush

n = int(input().split()[0])
a_list = list(map(int, input().split()))

b = ''

for i, a in enumerate(a_list):
    if i % 2 == 1:
        b = b + str(a)
    else:
        b = str(a) + b

if n % 2 == 0:
    b = b[::-1]

ans = ' '.join(list(b))

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
import math
for i in range(math.ceil(n/2)):
	b.append(a[n-1-2*i])
if n%2==0:
	for i in range(n//2):
		b.append(a[2*i])
else:
	for i in range(n//2):
		b.append(a[2*i+1])
print(b)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
a = list(map(int, input().split()))

b = collections.deque()
for i in a:
    if i % 2 == n % 2:
        b.appendleft(i)
    else:
        b.append(i)

for i in b:
    print(i, end=' ')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []

for i in range(n):
    tmp = a.pop(0)
    b.append(tmp)
    b = b[::-1]
    

print(b)

Submission status: Wrong Answer

Solution code:
from collections import deque
ans = deque()
n=int(input())
*l, = map(int,input().split())
r=True
for i in l:
  if r:
    r=False
    ans.append(i)
  else:
    r=True
    ans.appendleft(i)
s = [str(i) for i in ans]
print(' '.join(s))

Submission status: Wrong Answer

Solution code:
from collections import deque
ans = deque()
n=int(input())
*l, = map(int,input().split())
r=True
for i in l:
  if r:
    r=False
    ans.append(i)
  else:
    r=True
    ans.appendleft(i)
print(list(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
ans = []

for i, a in enumerate(A):
    if i%2==0:
        ans.append(a)
    else:
        ans.insert(0, a)

if n%2==1:
    ans.reverse()

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
ans = []
for a in A:
    ans.append(a)
    ans.reverse()
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = map(int, input().split())
l = []
for i, a in enumerate(A):
    if i%2 == 0:
        l.append(a)
    else:
        l.insert(0, a)
print(' '.join(map(str, l)))

Submission status: Wrong Answer

Solution code:

import collections
import itertools
import sys

def getint(): return int(input())
def getints(): return list(map(int, input().split()))

deq = collections.deque()
n=getint()
vs=getints()

front = True
for d in vs:
    if front:
        deq.append(d)
    else:
        deq.appendleft(d)
    front = not front

res = list(map(lambda s: str(s), deq))

print(" ".join(res))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range((n+1)//2):
  here = n-1-2*i
  b.append(str(a[here]))
for i in range(n//2):
  here = 2*i
  b.append(str(a[here]))
print(' '.join(b))

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = list(map(int, input().split()))

d = deque()
for i in range(n):
    if i % 2 != 0:
        d.append(a[i])
    else:
        d.appendleft(a[i])

if n % 2 == 0:
    list(d).sort(reverse=True)
    print(*d)
else:
    print(*d)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))

b=[]
k=N%2
for a in A:
    if k==a%2:
        b.insert(0,a)
    else:
        b.append(a)
print(b)

Submission status: Wrong Answer

Solution code:
n=int(input())
a_all=list(map(int,input().split()))
b=[]

for a in a_all:
    b.append(a)
    b=b[::-1]
print(b)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math
import itertools
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    A = inputList()
    
    b = []
    for i, val in enumerate(A):
        if i == 0:
            b.append(val)
            continue
        if i % 2 == 0:
            b.append(val)
        else:
            b.insert(0, val)
    
    print(*b)
    
        
if __name__ == "__main__":
	main()