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: Time Limit Exceeded

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = input().rstrip()
    a = list(int(_) for _ in input().split())
    b = []
    for i in range(len(a)):
        b.append(a[i])
        b = b[::-1]
    print(' '.join(str(_) for _ in b))
    
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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])
    
if n % 2 != 0:
  b.reverse()
  
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a = list(map(str, input().split()))
b = []
for num in a:
  b.append(num)
  b.reverse()
  
print(" ".join(b))

Submission status: Time Limit Exceeded

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

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

print(' '.join(B))

Submission status: Time Limit Exceeded

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

B = []
for i in range(N):
    if (N + i) % 2 == 0:
        B = B + [ str(A[i]) ]
    else:
        B = [ str(A[i]) ] + B

print(' '.join(B))

Submission status: Time Limit Exceeded

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

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

ans = []
for b in B:
    ans.append(str(b))
    ans.append(' ')
ans.pop()
print(''.join(ans))

Submission status: Time Limit Exceeded

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

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

ans = []
for b in B:
    ans.append(str(b))
    ans.append(' ')
ans.pop()
print(''.join(ans))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
b=[]
k=0
for i in map(int, input().split()):
  if k%2==0:
    b.append(i)
    k+=1
  else:
    b.insert(0,i)
    k+=1
if n%2!=0:
  b=b[::-1]
print(*b,sep=" ")

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
b=[]
for i in map(int, input().split()):
  b.append(i)
  b=b[::-1]
print(*b,sep=" ")

Submission status: Time Limit Exceeded

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
a = nl()
ans = []
if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0:
            ans.append(str(a.pop(0)))
        else:
            ans.insert(0, str(a.pop(0)))
else:
    for i in range(n):
        if i % 2 == 0:
            ans.insert(0, str(a.pop(0)))
        else:
            ans.append(str(a.pop(0)))
print(' '.join(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
nums = input().split()
ans = []
for num in nums:
    ans.append(num)
    ans = ans[::-1]
print(" ".join(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in a:
    b.append(i)
    b = list(reversed(b))
b = [str(b_) for b_ in b]
ans = " ".join(b)
print(ans)

Submission status: Time Limit Exceeded

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

b = []
for i in a:
  b.append(i)
  b.reverse()

print(*b)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
b=[]
if n%2==0:
    for i in range(n//2):
        b.append(l[2*i])
        b.insert(0,l[2*i+1])
else:
    for i in range(n//2):
        b.insert(0,l[2*i])
        b.append(l[2*i+1])
    b.insert(0,l[-1])
for i in b:
    print(i,end=' ')

Submission status: Time Limit Exceeded

Solution code:
import sys

n = int(input())
a = list(map(int, sys.stdin.readline().split()))
ans = []
for i in range(n):
    if i % 2 == 0:
        ans.insert(0, a[i])
    else:
        ans.append(a[i])

if len(a) % 2 == 0:
    ans.reverse()
print(' '.join(map(str,ans)))

Submission status: Time Limit Exceeded

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

B = []
if(n%2 == 0):
  p = n//2
  for i in range(p):
   B.insert(0,str(A[2*i+1]))
   B.append(str(A[2*i]))
elif(n%2 == 1):
  p = n//2 
  for i in range(p):
   B.insert(0,str(A[2*i]))
   B.append(str(A[2*i+1]))
  B.insert(0,str(A[2*p]))
  
b = ' '.join(B)
print(b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = list(map(str,input().split()))
t = s[0]
if n == 1:
    print(t)
elif n % 2 == 0:
    for i in range(1,n):
        if i % 2 == 1:
            t = s[i] + " " + t
        else:
            t = t + " " + s[i]
    print(t)
else:
    for i in range(1,n):
        if i % 2 == 0:
            t = s[i] + " " + t
        else:
            t = t + " " + s[i]
    print(t)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
a = list(map(int,input().split()))
b = ["A" for i in range(100001)]

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

while b[0] == "A" :
    del b[0]

while "A" in b:
    b.remove("A")

if n % 2 != 0:
    pass
else:
    b.reverse()

for i in range(len(b)):
    if i == len(b) - 1:
        print(b[i])
        break
    print(b[i],end = " ")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
a = list(map(int,input().split()))
b = ["A" for i in range(1000001)]

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

while "A" in b:
    b.remove("A")

if n % 2 != 0:
    pass
else:
    b.reverse()

for i in range(len(b)):
    if i == len(b) - 1:
        print(b[i])
        break
    print(b[i],end = " ")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

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

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

if n % 2 != 0:
    pass
else:
    b.reverse()

for i in range(len(b)):
    if i == len(b) - 1:
        print(b[i])
        break
    print(b[i],end = " ")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

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.reverse()
        b.append(a[i])
        b.reverse()

if n % 2 != 0:
    pass
else:
    b.reverse()

for i in range(len(b)):
    if i == len(b) - 1:
        print(b[i])
        break
    print(b[i],end = " ")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
alist = list(input().split())
b = alist[0]
n1 = (N -1) // 2
n2 = (N -1) % 2
for i in range(n1):
    b = b + " " + alist[2*i+1]
    b =  alist[2*i+2] + " " + b
if n2 == 1:
    b = b + " " + alist[-1]
    b = b[::-1]
print(b)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
alist = list(map(int,input().split()))
b = []
for a in alist:
    b.append(a)
    b = b[::-1]
ans = str(b[0])
for bb in b[1:]:
    ans = ans + " " + str(bb)
print(ans)

Submission status: Time Limit Exceeded

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: b.reverse()
print( ' '.join( map(str,b)) )

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int, input().split()))
X = [str(A[0])]
append_ = True if n % 2 != 0 else False
for a in A[1:]:
    if append_:
        X.append(str(a))
    else:
        X.insert(0, str(a))
    append_ = not append_
print(" ".join(X))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
print(*b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
n=int(input())
a=[int(i) for i in input().split()]
ans=deque([])
for i in a:
    ans.append(i)
    ans=list(reversed(ans))
print(*ans,sep=' ')

Submission status: Time Limit Exceeded

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

flg = True
if n % 2 == 0:
    flg = False

b = []

for x in a:
    if flg:
        b.insert(0, str(x))
    else:
        b.append(str(x))

    flg = not flg

print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=list(input().split())
b=a[0]
for i in range(1,N):
    b+=' '+a[i]
    b=b[::-1]
print(b)

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A = input().split()
    ans = A[0]
    for i in range(1, N):
        ans = (ans + " " + A[i])[::-1]
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()

ans = str(l[0])
if N%2 == 0:
	for i in range(1,N):
		if i%2!=0:
			ans = str(l[i])+" "+ans
		else:
			ans += " "+str(l[i])
else:
	for i in range(1,N):
		if i%2==0:
			ans = str(l[i])+" "+ans
		else:
			ans += " "+str(l[i])
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = IL()

ans = []
if N%2 == 0:
	for i in range(N):
		if i%2!=0:
			ans.insert(0,l[i])
		else:
			ans.extend([l[i]])
else:
	for i in range(N):
		if i%2==0:
			ans.insert(0,l[i])
		else:
			ans.extend([l[i]])
s = str(ans[0])
for i in range(1,N): 
	s += " "+str(ans[i])
print(s)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

b = []

for i in range(n-1,0,-2):
    print(a[i],end="")
    a.pop(i)
    print(" ",end="")
print(" ".join(map(str,a)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

b = []

for i in range(n):
    b.append(a[i])
    b.reverse()
print(" ".join(map(str,b)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a = []

b = []

argv = input().split()
for i in range(n):
    a.append(int(argv[i]))

for i in range(n):
    b.append(a[i])
    b.reverse()

print(*b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = []
X = list(map(int, input().split()))
for i in range(n):
    a = X[i]
    s.append(a)
    s.reverse()
for i in s:
    print(i, end = '')
    if(i!= n - 1):
        print(' ', end='')
print()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
L = [None]+list(input().split())
even = []
odd = []
if n % 2 == 0:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    for j in range(len(even[::-1])):
        if j == len(even) - 1:
            print(even[::-1][j],end=' ')
        else:
            print(even[::-1][j],end=' ')
    for y in range(len(odd)):
        if y == len(odd) - 1:
            print(odd[y],end='')
        else:
            print(odd[y],end=' ')
    print()
else:
    for i in range(1,1+n):
        if i % 2 == 0:
            even.append(L[i])
        else:
            odd.append(L[i])
    for y in range(len(odd[::-1])):
        if y == len(odd) - 1:
            print(odd[::-1][y],end=' ')
        else:
            print(odd[::-1][y],end=' ')
    for x in range(len(even)):
        if x == len(even) -1:
            print(even[x],end='')
        else:
            print(even[x],end=' ')
    print()

Submission status: Time Limit Exceeded

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

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

if n % 2 == 1:
    b = list(reversed(b))

print(' '.join(b))

Submission status: Time Limit Exceeded

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

b = []
for x in a:
    b.append(x)
    b = list(reversed(b))

print(' '.join(b))

Submission status: Time Limit Exceeded

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

for i in range(n//2):
    b.append(a.pop(0))
    b.insert(0, a.pop(0))

if len(a) == 1:
    b.append(a.pop(0))
    b.reverse()

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))
A.reverse()
ans = []
left = True
while A:
    if left: ans = [A.pop()] + ans
    else: ans.append(A.pop())
    left = not left
if n % 2 == 0: ans.reverse()
print(' '.join(str(a) for a in ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))
A.reverse()
ans = []
left = True
while A:
    if left: ans.insert(0,A.pop())
    else: ans.append(A.pop())
    left = not left
if n % 2 == 0: ans.reverse()
print(' '.join(str(a) for a in ans))

Submission status: Time Limit Exceeded

Solution code:
N = input()

A = map(int,raw_input().split())

B = str(A[0])

for i in range(1,N):
    B += ' '+str(A[i])
    B = B[::-1]

print B

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
alist = list(map(int,input().split()))
b = []
for i in range(n):
    if i%2 == 0:
        front = int(i/2)
        b.insert(front,alist[-1-i])
    else:
        if i!=1:
            back = -int((i-1)/2)
            b.insert(back,alist[-1-i])
        else:
            b.append(alist[-1-i])
for j in range(n):
    print(b[j],end=" ")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
alist = list(map(int,input().split()))
b = []
c = []
for i in range(n):
    b.append(alist[i])
    blen = len(b)
    c = b[::-1]
    b = [c[j] for j in range(blen)]
    c = []        
blen = len(b)
for k in range(blen):
    print(b[k],end=" ")

Submission status: Time Limit Exceeded

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())|	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import collections
def inpl(): return list(map(int, input().split()))

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

b = []
for a_i in a:
  b.append(a_i)
  b.reverse()

print(*b, sep=" ")

Submission status: Time Limit Exceeded

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(" ".join(map(str,b)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = [int(i) for i in input().split()]
B = []
for i in range(n):
    B.append(A.pop(0))
    B.reverse()
print(' '.join(map(str, B)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans=[]
[ans.append(a[i]) if i%2 ==0 else ans.insert(0,a[i]) for i in range(n)]
print(str(ans).replace("[","").replace("]","").replace(",","") if n%2 ==0 else str(ans[::-1]).replace("[","").replace("]","").replace(",","") )

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

print(str(ans).replace("[","").replace("]","").replace(",","") if n%2 ==0 else str(ans[::-1]).replace("[","").replace("]","").replace(",","") )

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = []
for i in range(n):
    ans.append(a[i])
    ans.reverse()
print(' '.join(map(str, ans)))

Submission status: Time Limit Exceeded

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

b=[]

for i in range(n):
  b.append(a[i])
  b.reverse()

for j in range(n):
  print(b[j], end=' ')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(int(i) for i in input().split())
b = []
for i in range(n):
 b.append(a[i])
 b.reverse()
print(*b)

Submission status: Time Limit Exceeded

Solution code:
int_n = int(input())
ar_int_a = list(map(int, input().split()))
ar_int_b = list()
for i in ar_int_a:
    ar_int_b.append(i)
    ar_int_b = ar_int_b[::-1]

print(" ".join(map(str, ar_int_b)))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
b=[]
for i in range(n):
    if i%2==0:
        l=[a[i]]
        l.extend(b)
        b=l
        
    else:
        b.append(a[i])

if n%2==0:
    b.reverse()

for i in range(n):
    if i!=n-1:
        print(b[i],end=" ")
    else:
        print(b[i])

Submission status: Time Limit Exceeded

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

for i in range(n):
    if i!=n-1:
        print(b[i],end=" ")
    else:
        print(b[i])

Submission status: Time Limit Exceeded

Solution code:
#066-C
n=int(input())
a=list(map(int,input().split()))
b=[]
if n%2==0:
    for i in range(n):
        if i%2==0:
            b=b+[a[i]]
        else:
            b=[a[i]]+b
else:
     for i in range(n):
        if i%2==1:
            b=b+[a[i]]
        else:
            b=[a[i]]+b
for i in range(n):
    print(b[i],end=" ")
print()

Submission status: Time Limit Exceeded

Solution code:
class Node:
  def __init__(self,data):
    self.left=None
    self.right=None
    self.data=data

class BST:
  def __init__(self,num_list):
    self.root=None
    for node in num_list:
      self.insert(node)

  def insert(self,data):
    n = self.root
    if n == None:
      self.root=Node(data)
      return
    else:
      while True:
        entry=n.data
        if data<entry:
          if n.left is None:
            n.left=Node(data)
            return
        elif data > entry:
          if n.right is None:
            n.right=Node(data)
            return
          n=n.right
        else:
          n.data=data
          return
  def search(self,search):
    n = self.root
    if n is None:
      return None
    else:
      lst=[]
      lst.append(n)
      while len(lst)>0:
        node=lst.pop()
        if node.data==search:
          return node.data
        if node.left is not None:
          lst.append(node.left)
        if node.right is not None:
          lst.append(node.right)
      return False

n=int(input())
A=list(map(int,input().split()))
bst=BST(A)
B=[]
for i in range(n):
  B.append(bst.search(A[i]))
  B=B[::-1]
print(*B)

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int,input().split()))
L=[]
for i in range(n):
  if i%2==n%2:L.append(l[i])
  else:L.insert(0,l[i])
for j in range(n):
  print(L[j],end=' ')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a  = list(input().split())
ans = a[0]
for i in range(1, n):
	if i%2==n%2:
		ans += " " + a[i]
	else:
		ans = a[i] + " " + ans
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
import sys

n = int(input().strip())
a_tmp = list(map(int, input().strip().split(" ")))

al = np.array(a_tmp,dtype=np.int32)
np.append(al, a_tmp)

bl = []

for a in al:
    bl.append(a)
    bl.reverse()

for b in bl:
    sys.stdout.write(str(b) + " ")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [i for i in input().split()]
outStr = []
if n % 2 == 0:
    for i in range(n):
        # print("i:{} outStr:{}".format(i, outStr))
        if i % 2 == 1:
            outStr = [a[i]] + outStr
        else:
            outStr.append(a[i])
        # print("i:{} outStr:{}\n".format(i, outStr))
    print(" ".join(outStr))
else:
    for i in range(n):
        if i % 2 == 0:
            outStr = [a[i]] + outStr
        else:
            outStr.append(a[i])
    print(" ".join(outStr))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num_list = list(map(int, input().split()))
b = []
for a in num_list:
    b.append(a)
    b = [i for i in (reversed(b))]
for i in range(len(b)):
    if i != len(b)-1:
        print(b[i],end="")
        print(" ", end="")
    else:
        print(b[i])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().strip().split(' ')))
b = []
for i in range(n):
  b.append(a[i])
  b.reverse()
str = [str(n) for n in b]
print(' '.join(str))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().strip().split(' ')))
b = []
for i in range(n):
  b.append(a[i])
  b.reverse()
for i in range(n):
  b[i] = str(b[i])
print(' '.join(b))

Submission status: Time Limit Exceeded

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

B = []

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

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

print()

Submission status: Time Limit Exceeded

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

B = []

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

print(*B)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in a:
    ans.append(i)
    ans = ans[::-1]
let = ""
for j in ans:
    let += str(j) + " "
print(let[:-1])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(input().split())
b=[]
for i in range(n):
    b.append(a[i])
    b.reverse()
print(' '.join(b))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
for p in a:
    b.append(p)
    b.reverse()
for p in b:
    print(str(p) + " ", end="")
print()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
L = list(map(int, input().split()))
res = []
for i in range(N):
    if i%2 == 1:
        res.insert(0,L[i])
    else:
        res.append(L[i])

if N%2 == 1:
    res.reverse()
for i in range(N):
    print(str(res[i]) + ' ', end="")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
L = list(map(int, input().split()))
res = []
for i in range(N):
    res.append(L[i])
    res.reverse()
for i in range(N):
    print(str(res[i]) + ' ', end="")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N =  int(input())
a = list(map(int,input().split( )))
ans = a[0]
if N % 2  == 1:
	for i in range(N-1):
		if (i+1) % 2 == 0:
			ans = str(a[i+1]) + ' ' + str(ans)
		else:
			ans = str(ans) + ' ' + str(a[i+1])
else:
	for i in range(N-1):
		if (i+1) % 2 == 1:
			ans = str(a[i+1]) + ' ' + str(ans)
		else:
			ans = str(ans) + ' ' + str(a[i+1])

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(input().split())
s = a[0]
for i in range(1,n):
  if (i+n)%2 == 0:
    s = s + " " + a[i]
  else:
    s = a[i] + " " + s
print(s)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = [int(i) for i in input().split()]
b = str(A[0])

for i in range(1, n):
    if i % 2 == n % 2:
        b += " " + str(A[i])
    else:
        b = str(A[i]) + " " + b

print(b)

Submission status: Time Limit Exceeded

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

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


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

Submission status: Time Limit Exceeded

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

for i in range(n):
    if i % 2 != 0:
        b = [A[i]] + b
    else:
        b += [A[i]]

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

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

Submission status: Time Limit Exceeded

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

s = []

for i in range(n):
	s.append(a[i])
	s.reverse()
s = map(str,s)
print(' '.join(s))

Submission status: Time Limit Exceeded

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

for i in range(1,N):
    B.append(A[i])
    B.reverse()

str_B = map(str, B)
mojiretu = ' '.join(str_B)
print(mojiretu)

Submission status: Time Limit Exceeded

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

for i in range(1,N):
    B.append(A[i])
    B.reverse()

for i in B:
    print(i,end=" ")

Submission status: Time Limit Exceeded

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

p = N%2
for i in range(N):
    if i%2 != p:
        ans.insert(0,str(a[i]))
    else:
        ans.append(str(a[i]))

print(" ".join(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
list_a = list(map(int, input().split()))
list_b = []
for i in range(0,n):
    list_b.append(list_a[i])
    list_b = list_b[::-1]
for i in range(0,n):
    list_b[i] = str(list_b[i])
print(" ".join(list_b))