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:
#!/usr/bin/env python3
import sys


def solve_naive(n: int, a: "List[int]"):
    b = list()
    for i in range(n):
        b.append(str(a[i]))
        b.reverse()
    print(" ".join(b))
    return

def solve_(n: int, a: "List[int]"):
    a = list(map(str, a))
    b = list()
    for i in range(n):
        if i % 2 == 0:
            # push
            b.insert(0, a[i])
        else:
            # append
            b.append(a[i])
    if n % 2 == 0:
        b.reverse()
    print(" ".join(b))
    return

def solve(n: int, a: "List[int]"):
    a = list(map(str, a))
    b = list()
    for i in range(n):
        if i % 2 == (n-1) % 2:
            # push
            b.insert(0, a[i])
        else:
            # append
            b.append(a[i])
    print(" ".join(b))
    return

# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(n) ]  # type: "List[int]"
    solve(n, a)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys


def solve_naive(n: int, a: "List[int]"):
    b = list()
    for i in range(n):
        b.append(str(a[i]))
        b.reverse()
    print(" ".join(b))
    return

def solve(n: int, a: "List[int]"):
    a = list(map(str, a))
    b = list()
    for i in range(n):
        if i % 2 == 0:
            # push
            b.insert(0, a[i])
        else:
            # append
            b.append(a[i])
    if n % 2 == 0:
        b.reverse()
    print(" ".join(b))
    return

# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(n) ]  # type: "List[int]"
    solve(n, a)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys


def solve(n: int, a: "List[int]"):
    b = list()
    for i in range(n):
        b.append(str(a[i]))
        b.reverse()
    print(" ".join(b))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(n) ]  # type: "List[int]"
    solve(n, a)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

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

if N % 2 == 1:
    ret.reverse()

print(*ret)

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 = [i for i in input().split()]
b = []
ans = ""

if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0:
            ans += a[i] + " "
        else:
            ans = a[i] + " " + ans
    """
    for i in range(n):
        if i != n-1:
            ans += str(b[i]) + " "
        else:
            ans += str(b[i])
    """
else:
    for i in range(n):
        if i % 2 != 0:
            ans += a[i] + " "
        else:
            ans = a[i] + " " +ans

print(ans[:len(ans)-1])

Submission status: Time Limit Exceeded

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

if n % 2 == 0:
    for i in range(n):
        if i % 2 == 0:
            b.append(a[i])
        else:
            b = [a[i]] + b
    for i in range(n):
        if i != n-1:
            ans += str(b[i]) + " "
        else:
            ans += str(b[i])
else:
    for i in range(n):
        if i % 2 != 0:
            b.append(a[i])
        else:
            b = [a[i]] + b
    for i in range(n):
        if i != n-1:
            ans += str(b[i]) + " "
        else:
            ans += str(b[i])

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
while a!=[]:
    b.append(a.pop(0))
    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 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])

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

if len(b) == 1:
    print(b[0])

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

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]

if len(b) == 1:
    print(b[0])

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())


b=[]
k=N%2
for a in list(map(int,input().split())):
    if k==a%2:
        b.insert(0,a)
    else:
        b.append(a)
print(' '.join(map(str,b)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

ans = ' '.join(ans)
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, str(a[i]))
    else:
        b.append(str(a[i]))

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

ans = ' '.join(ans)
print(ans)

Submission status: Time Limit Exceeded

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):
        b.append(val)
        b = b[::-1]
        #print(*b)
    
    print(*b)
    
        
if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

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

print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: UTF-8 -*-
# ABC066_C

N = int(input())
tmp = input()
list = []
list = tmp.split()

ans = []
if (N % 2 == 0):
    for i in range(1, N + 1):
        x = list[i - 1]
        if (i % 2 != 0):
            ans.append(x)
        else:
            ans.insert(0, x)
else:
    for i in range(1, N + 1):
        x = list[i - 1]
        if (i % 2 != 0):
            ans.insert(0, x)
        else:
            ans.append(x)
for i in range(0, N):
    print(ans[i], end=" ")

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:
def main():
    n = int(input())
    A = list(map(int, input().split()))
    b = []

    for a in A:
        b.append(a)
        b.reverse()
    print(*b)

main()

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(*b)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
s = N % 2
b = A[0]

for i in range(1, N):
    if (i % 2 != s):
        b = A[i] + " " + b
      
    else:
        b = b + " " + 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):
    if i % 2 == 1:
        b.append(a[i])
    else:
        b.insert(0,a[i])


if n % 2 == 1:
    for i in b:
        print(i, end=" ")
else:
    for i in reversed(b):
        print(i, end=" ")

Submission status: Time Limit Exceeded

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


for i in range(1,n) :
    if (i % 2 == 0) :
        b = b + " " + a[i]
    else :
        b = a[i] + " " + b
    
if (n % 2 == 0) :
    print(b)
else :
    arr = b.split()
    arr = list(reversed(arr))

    print(' '.join(arr))

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:
def main():
    n = int(input())
    A = input().split()
    ans = []
    if n % 2 == 0:
        for i in range(0, n - 1, 2):
            ans.append(A[i])
            ans = [A[i + 1]] + ans
    else:
        for i in range(0, n - 1, 2):
            ans.append(A[i + 1])
            ans = [A[i]] + ans
        ans = [A[-1]] + ans
    print(' '.join(ans))


main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    A = input().split()
    ans = []
    if n % 2 == 0:
        for i in range(0, n - 1, 2):
            ans.append(A[i])
            ans.insert(0, A[i + 1])
    else:
        for i in range(0, n - 1, 2):
            ans.append(A[i + 1])
            ans.insert(0, A[i])
        ans.insert(0, A[-1])
    print(' '.join(ans))


main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    a = input().split()
    k = n % 2
    ans = ''
    for i in range(n):
        if i % 2 == k:
            ans += a[i] + ' '
        else:
            ans = a[i] + ' ' + ans
    print(ans.rstrip(' '))


main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    A = input().split()
    B = []
    k = n % 2
    for i in range(n):
        if i % 2 == k:
            B.append(A[i])
        else:
            B.insert(0, A[i])
    print(' '.join(B))


main()

Submission status: Time Limit Exceeded

Solution code:

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

lis = [a[0]] + [0] * (n-1)
fo = 1
be = -1

if n % 2 == 0:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:

            lis[be] = a[i]
            be -= 1
            #ans = str(a[i])+" "+ans

        else:

            lis[fo] = a[i]
            fo += 1
            #ans = ans+" "+ str(a[i])


else:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:
            
            lis[fo] = a[i]
            fo += 1
            #ans = str(a[i])+" "+ans

        else:
            
            lis[be] = a[i]
            be -= 1
            #ans = ans+" "+ str(a[i])

            
for i in range(n):

        i -= n//2

        ans += str(lis[i]) + " "


#print(lis)
print(ans)

Submission status: Time Limit Exceeded

Solution code:

n = int(input())
a = list(map(int,input().split()))
ans = str(a[0])

if n % 2 == 0:

    for i in range(n-1):

        i+=1

        if i % 2 == 1:

            ans = str(a[i])+" "+ans

        else:

            ans = ans+" "+ str(a[i])

else:

    for i in range(n-1):

        i+=1

        if i % 2 == 0:

            ans = str(a[i])+" "+ans

        else:

            ans = ans+" "+ str(a[i])

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

for i in range(N):
    print(ans[i], end = " ")
print("")

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    a = input().split()
    ans = []
    add = ans.append
    rev = ans.reverse
    for i in range(n):
        add(a[i])
        rev()
    print(" ".join(ans))
if __name__=="__main__": main()

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys


def solve(n: int, a: "List[int]"):
    l = []
    for i in range(n):
        l.append(a[i])
        l.reverse()

    l = map(str, l)
    print(' '.join(l))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = int(next(tokens))  # type: int
    a = [ int(next(tokens)) for _ in range(n) ]  # type: "List[int]"
    solve(n, a)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

# B = [0 for i in range(N)]
B = []
for i in range(N):
    B.append(A[i])
    B = B[::-1]


print(' '.join(B))

Submission status: Time Limit Exceeded

Solution code:
n =int(input())
ls = []

if n%2==0:
    for i,j in enumerate(input().split()):
        if i%2==0:
            ls.append(j)
        else:
            ls.insert(0,j)
else:
    for i,j in enumerate(input().split()):
        if i%2==1:
            ls.append(j)
        else:
            ls.insert(0,j)

print(" ".join(ls))

Submission status: Time Limit Exceeded

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

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

if n % 2 == 0:
  print(' '.join([str(i) for i in b]))
else: 
  b.reverse()
  print(' '.join([str(i) for i in b]))

Submission status: Time Limit Exceeded

Solution code:
n =int(input())
ls = []
for i,j in enumerate(input().split()):
    if n%2==0:
        if i%2==0:
            ls.append(j)
        else:
            ls.insert(0,j)
    else:
        if i%2==1:
            ls.append(j)
        else:
            ls.insert(0,j)
print(" ".join(ls))

Submission status: Time Limit Exceeded

Solution code:
n =int(input())

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

ls = []

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

print(" ".join(ls))

Submission status: Time Limit Exceeded

Solution code:
n =int(input())

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

ls = []

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

print(" ".join(ls))

Submission status: Time Limit Exceeded

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n=I()
  l=LS()

  s=l[0]
  if n%2==0:
    for i in range(1,len(l)):
      if i%2==0:
        s=s+' '+l[i]
      else:
        s=l[i]+' '+s
  else:
    for i in range(1,len(l)):
      if i%2==1:
        s=s+' '+l[i]
      else:
        s=l[i]+' '+s

  return s

print(main())

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]
for i in range(n-1):
    print(b[i], end=" ")
print(b[n-1])

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

for i in b:
    print('{} '.format(i), end='')
print()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

if len(A)%2 == 1:
  ans = list(reversed(ans))

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

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):
        if i % 2 == 0:
            ans.append(a[i])
        else:
            ans.insert(0, a[i])
else:
    for i in range(n):
        if i % 2 != 0:
            ans.append(a[i])
        else:
            ans.insert(0, a[i])
print(" ".join(map(str, ans)))

Submission status: Time Limit Exceeded

Solution code:
# ABC066C - pushpush (ARC077)
n = int(input())
lst = list(map(int, input().rstrip().split()))
b = []
parity = n % 2
for i in lst:
    if i % 2 == parity:
        b = [i] + b
    else:
        b += [i]
print(*b)

Submission status: Time Limit Exceeded

Solution code:
# ABC066C - pushpush (ARC077)
n = int(input())
lst = list(map(int, input().rstrip().split()))
b = []
for i in lst:
    b += [i]
    b = b[::-1]
print(*b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
ans = A[0]
for i in range(1, N):
	if i%2 == N%2: ans = ans + ' ' + A[i]
	else: ans = A[i] + ' ' + ans
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
ans = A[0]
for i in range(1, N):
	if i%2 == 0: ans = ans + ' ' + A[i]
	else: ans = A[i] + ' ' + ans
if N%2 == 1:
	anslist = ans.split()
	anslist.reverse()
	ans = anslist[0]
	for i in range(1, N):
		ans = ans + ' ' + anslist[i]
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
b = []
for ind,i in enumerate(a):
    if(ind%2==0):
        b.append(i)
    else:
        b.insert(0,i)
if(N%2!=0):
    b.reverse()
for i in b[:-1]:
    print(i,end=' ')
print(b[-1])

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==1:
        b=[a[i]]+b
    else:
        b+=[a[i]]
if n%2==0:
    print(*b)
else:
    print(*b[::-1])

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==1:
        b=[a[i]]+b
    else:
        b.append(a[i])
if n%2==0:
    print(*b)
else:
    print(*b[::-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
num_list = [ v for v in input().split() ]

b_list = []

for i in num_list:
	b_list.append(i)
	b_list.reverse()
print(" ".join(b_list))

Submission status: Time Limit Exceeded

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

for c,j in enumerate(a):
    if c%2 == 0:
        b.append(j)
    else:
        b.insert(0,j)

if len(a)%2==0:
    print(' '.join(b))
else:
    print(' '.join(b[::-1]))

Submission status: Time Limit Exceeded

Solution code:
n,*a=map(int,open(0).read().split())
b=[]
for i in range(n):b=(b+[a[i]])[::-1]
print(*b)

Submission status: Time Limit Exceeded

Solution code:
N, *a = map(int, open(0).read().split())
b = []
for i, v in enumerate(a):
    if i % 2 == 0:
        b.append(v)
    else:
        b.insert(0, v)
        
if N % 2 == 0:
    print(*b)
else:
    print(*b[::-1])

Submission status: Time Limit Exceeded

Solution code:
operateNum = int(input())

outputList = []
nums = input().split(" ")
#print(nums)
for count in range(len(nums)):
    outputList.append(nums[count])
    outputList.reverse()

for out in outputList:
    print(out, end=" ")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = []
for i,a in enumerate([int(i) for i in input().split()]):
    a = str(a)
    #if i%2 == 0:
    ans.append(a)
    ans = ans[::-1]
    #else:
    #    ans.insert(0,a)
print(' '.join(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: b.insert(0, a[i])
    else: b.append(a[i])
print(" ".join(map(str, b[::(-1)**(n%2)])))

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:
# -*- coding:utf-8 -*-

def solve():
    n = int(input())
    A = input().split()

    """方針
    A = 0 6 7 6 7 0
    i | b
    ---------------
    1 | 0
    2 | 0 6 (本当は逆で6 0)
    3 | 7 0 6
    4 | 7 0 6 6 (本当は逆で 6 6 0 7)
    5 | 7 7 0 6 6
    6 | 7 7 0 6 6 0 (本当は逆で0 6 6 0 7 7) 

    ・iが偶数のとき、bの後ろにA[i]を追加する
    ・iが奇数のとき、bの前にA[i]を追加する

    上の操作をn回すべてしたあとに、

    ・nが偶数なら答えを反転する
    ・nが奇数なら答えはそのまま

    ただし、A[i]は2桁以上の数字の可能性も考慮すること
    """

    # 1 2 3 -> 3 1 2
    b = []
    for i in range(1, n+1):
        if i%2 == 0:
            b.append(A[i-1])
        else:
            b.insert(0, A[i-1])

    if n%2 == 0:
        ans = ""
        for i in range(n-1, -1, -1):
            ans += b[i] + " "
        print(ans[:-1])
    else:
        ans = " ".join(b)
        print(ans)


if __name__ == "__main__":
    solve()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math


N = int(input())
An = list(map(int, input().split()))
Bn = []
for a in An:
  Bn = [a] + Bn[::-1]

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

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 i in range(n):
    b.append(str(a[i]))
    b = b[::-1]
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
#ABC066C
import pprint
n = int(input())
ai = list(map(int, input().split()))
bi = []
for a in ai:
    bi.append(a)
    bi.reverse()
for b in bi:
    print(b, end=" ")

Submission status: Time Limit Exceeded

Solution code:
n, *a = map(int, open(0).read().split())
b = []
for i in a:
  b.append(int(i))
  b.reverse()

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

Submission status: Time Limit Exceeded

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

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

if not len(A) % 2:
	print(*b)
else:
	print(*b[::-1])

Submission status: Time Limit Exceeded

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

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

print(' '.join(map(str,o[::-1] if n%2 else o)))

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.reverse()

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):
  b.append(str(a[i]))
  b.reverse()
print(" ".join(b))

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
b = []
flg = False
if n % 2 == 0:
    flg = True
for e in a:
    if flg:
        b.append(e)
        flg = False
    else:
        b.insert(0, e)
        flg = True
print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
b = []
flg = True
for e in a:
    if flg:
        b.append(e)
        flg = False
    else:
        b.insert(0, e)
        flg = True
if n % 2 == 1:
    b.reverse()
print(' '.join(map(str, b)))

Submission status: Time Limit Exceeded

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math


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

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

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

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

print("")

Submission status: Time Limit Exceeded

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter
#以下てんぷら
def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)

n = ip()                                     #入力整数1つ
#a,b,t= (int(i) for i in input().split())       #入力整数横2つ以上
a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#k = ip()                      #入力セット(整数改行あり)(1/2)
#v=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
#こっから本文
s = [a[0]]
if n%2:
    for i in range(1,n):
        if i%2:
            s.append(a[i])
        else: s.insert(0,a[i])
else:
    for i in range(1, n):
        if i % 2==0:
            s.append(a[i])
        else:
            s.insert(0, a[i])
for i in range(n):
    print(s[i],end=' ')
print()

Submission status: Time Limit Exceeded

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

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.insert(0, a[i])
        else:
            b.append(a[i])
else:
    for i in range(n):
        if i % 2:
            b.insert(0, a[i])
        else:
            b.append(a[i])

print(' '.join(b))