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:
n = int(input())
a = list(map(int, input().split()))
b_1 = []
b_2 = []
b = []
'''
for i in range(len(a)):
	b.append(a[i])
	b = b[::-1]
for i in range(len(b)):
	print(b[i], end = ' ')
'''
for i in reversed(range(len(a))):
	if i % 2 != 0:
		b_1.append(a[i])
	else:
		b_2.append(a[i])
b_2.reverse()
b.extend(b_1)
b.extend(b_2)
for i in range(len(b)):
	print(b[i], end = ' ')

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b_1 = []
b_2 = []
b = []
'''
for i in range(len(a)):
	b.append(a[i])
	b = b[::-1]
for i in range(len(b)):
	print(b[i], end = ' ')
'''
for i in reversed(range(len(a))):
	if i % 2 == 0:
		b_1.append(a[i])
	else:
		b_2.append(a[i])
b_2.reverse()
b.extend(b_2)
b.extend(b_1)
for i in range(len(b)):
	print(b[i], end = ' ')

Submission status: Wrong Answer

Solution code:
#from collections import deque
n = int(input())
a_list = list(map(int, input().split()))
b = ''
#q = deque([]) 
for i in range(n):
    if i%2 == 0:
        if i == 0:
            b += str(a_list[i])
        else:
            b += ' ' + str(a_list[i])
        #q.append(a_list[i])
    else:
        b = str(a_list[i]) + ' ' + b
        #q.appendleft(a_list[i])
print(b)

Submission status: Wrong Answer

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

for i in range(n - 1, -1, -2):
    print(A[i], end = " ")
for j in range(0, n - 1, 2):
    print(A[j], end = " ")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())

result = deque()
index = 0

for i in input().split():
    if index % 2 == 1:
        result.appendleft(i)
        index += 1
    else:
        result.append(i)
        index += 1

print(" ".join(result))

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = raw_input().split()

a = []
b = []

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = raw_input().split()

a = []
b = []

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = raw_input().split()

a = []
b = []

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
s=list(input().split())
if N>=2:
    t=s[N-1::-2]+s[0::2]
    for i in range(N):
        print(t[i],end=" ")
else:
    print(s[0])

Submission status: Wrong Answer

Solution code:
N=int(input())
s=list(input().split())
t=s[N-1::-2]+s[0::2]
for i in range(N):
    print(t[i],end=" ")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
if n%2 == 0:
    s = a[::-2]+a[::2]
else:
    s = a[n-2::-2]+a[::2]
print(" ".join(s))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
s = a[::-2]+a[::2]
print(" ".join(s))

Submission status: Wrong Answer

Solution code:
a = input().split()
s = a[::-2]+a[::2]
print(" ".join(s))

Submission status: Wrong Answer

Solution code:
n = int(input())
lis = []
li = list(map(str,input().split()))
if n % 2 == 1:
    lis.append(li[0])
    li.pop(0)
for i in range(n//2):
    lis.append(li[i])
    lis.insert(0,li[i+1])
print(" ".join(lis))

Submission status: Wrong Answer

Solution code:
n = int(input())
a=input().split()
l=n - n %2-1
e=[i for i in a[l::-2]]  
o=[i for i in a[::2]]
e.extend(o)
if n % 2 ==0:
  print(*e)
else:
  print(*e[::-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
a=input().split()
l=n - n %2-1
e=[i for i in a[l::-2]]  
o=[i for i in a[::2]]
e.extend(o)
print(*e)

Submission status: Wrong Answer

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

even = [A[i] for i in range(n) if i % 2 == 0]
print(even)
odd = [A[i] for i in range(n) if i % 2 != 0]
print(odd)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
ans = ""
if n % 2 == 0:
  for i in range(len(l)):
    if not i % 2 == 0:
      ans = str(l[i]) + ans
    else:
      ans = ans + str(l[i])
else:
  for i in range(len(l)):
    if not i % 2 == 0:
      ans = ans + str(l[i])
    else:
      ans = str(l[i]) + ans

print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
# 偶数回目は前に入れる
n = int(input())
l = list(map(int, input().split()))
ans = ""
for i in range(n):
  if i == 0:
    ans += str(l[i])
    continue

  if n % 2 == 0:
    if not i % 2 == 0:
      ans = str(l[i]) + ans
    else:
      ans += str(l[i])
  else:
    if not i % 2 == 0:
      ans += str(l[i])
    else:
      ans = str(l[i]) + ans

print(" ".join(ans))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

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

def cal(p):
    if(p==1 or p==2):
        lst=reversed(list(enumerate(a)))
    else:
        lst=list(enumerate(a))
    for k,v in lst:
        if(k%2==(p%2)):
            print(str(v)+" ", end="")

if(n%2==1):
    cal(2)
    cal(1)
    print()
else:
    cal(1)
    cal(0)
    print()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

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

for i in a:
    b.append(i)
    b.reverse()

for i in b:
    print(str(i)+" " if(i!=b[-1]) else i, end='')
print()

Submission status: Wrong Answer

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

N = int(input())
data =  input()
a = data.split(" ")

if N%2 == 0:
    b = a[::-2]
    b.extend(a[::2])
    for i in b:
        print(i, end = " ")

else:
    b = a[::2]
    b.extend(a[-2::-2])
    for i in b:
        print(i, end = " ")

Submission status: Wrong Answer

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

N = int(input())
data =  input()
a = data.split(" ")

if N%2 == 0:
    b = a[::-2]
    b.extend(a[::2])
    for i in b:
        print(i, end = "")

else:
    b = a[::2]
    b.extend(a[-2::-2])
    for i in b:
        print(i, end = "")

Submission status: Wrong Answer

Solution code:
from collections import deque
n= input()
a = raw_input().split()
#print a

l=[ i for i in range(n)]
l_gusu=l[0::2]
l_kisu=l[1::2]

ans=""

for i in reversed(list(l_gusu)):
	#print i,a[i]
	ans+=(a[i]+" ")

for i in l_kisu:
	ans+=(a[i]+" ")

if n%2==0:
	print ans[::-1].strip()
else:
	print ans.strip()

Submission status: Wrong Answer

Solution code:
from collections import deque


def solve():
    n = int(input())
    a = list(map(str, input().split(" ")))
    ans = deque()

    i = 0
    if n % 2:
        while i != n:
            if i % 2:
                ans.append(a[i])
            else:
                ans.appendleft(a[i])
            i += 1
    else:
        while i != n:
            if i % 2:
                ans.append(a[i])
            else:
                ans.appendleft(a[i])
            i += 1

    print(" ".join(ans))


solve()

Submission status: Wrong Answer

Solution code:
from collections import deque


def solve():
    n = int(input())
    a = list(map(str, input().split(" ")))
    ans = deque()

    i = 0
    while i != n:
        if i % 2:
            ans.append(a[i])
        else:
            ans.appendleft(a[i])

        i += 1

    print(" ".join(ans))


solve()

Submission status: Wrong Answer

Solution code:
from collections import deque


def solve():
    n = int(input())
    a = list(map(str, input().split(" ")))
    d_left = deque()
    d_right = deque()

    i = n -1
    while i > 0:
        d_left.append(a[i])
        d_right.appendleft(a[i - 1])
        i -= 2

    if n % 2:
        ans = list(d_left) + list(a[0]) + list(d_right)
    else:
        ans = list(d_left) + list(d_right)

    if n == 1:
        print("".join(ans))
    else:
        print(" ".join(ans))


solve()

Submission status: Wrong Answer

Solution code:
from collections import deque


def solve():
    n = int(input())
    a = list(map(str, input().split(" ")))
    d_left = deque()
    d_right = deque()

    i = n -1
    while i > 0:
        d_left.append(a[i])
        d_right.appendleft(a[i - 1])
        i -= 2

    if n % 2:
        ans = list(d_left) + list(a[0]) + list(d_right)
    else:
        ans = list(d_left) + list(d_right)

    print(d_left)
    print(d_right)
    print(" ".join(ans))


solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(0,n,2):
    odd.append(a[i])
for i in range(1,n,2):
    even.append(a[i])

if n%2 == 0:
    even.reverse()
    ans = even + odd
else:
    odd.reverse()
    ans = odd + even
print("".join(ans))

Submission status: Wrong Answer

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

b = [0]*n

for i in range(n//2):
    b[i] = a[-1-2*i]
    b[n-i-1] = a[-2-2*i]

if n % 2 == 1:
    b[n//2] = a[0]

print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = input().split()
b_list = list()
i = 0

while i < n:
    b_list.append(int(array[i]))
    new_list = []
    while len(b_list) != 0:
        new_list.append(b_list.pop())
    b_list = list(new_list)
    i += 1
    print(b_list)

i = 0
while i < n:
    print(b_list[i], end = ' ')
    i += 1

Submission status: Wrong Answer

Solution code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
n = int(input())
a = input().split()
b = []
if n == 1:
  b.append(a[0])
else:
  for i in range(n-1, 0, -2):
    b.append(a[i])
  b.append(a[0])
  if n % 2 == 0:
    for i in range(1, n-1, 2):
      b.append(a[i])
  else:
    for i in range(2, n-1, 2):
      b.append(a[i])
print(' '.join(b))

Submission status: Wrong Answer

Solution code:
#!/usr/bin
# -*- coding="utf-8" -*-
 
n = int(input())
a = input().split()
b = []
if n == 1:
  b.append(a[0])
else:
  for i in range(n-1, 0, -2):
    b.append(a[i])
  for i in range(0, n-1, 2):
    b.append(a[i])
    if i == 0 and n % 2 == 1:
      i = 1
      b.append(a[1])
print(' '.join(b))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
from collections import deque

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

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

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

print(B)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    s = input()
    data = list(s)
    while len(data):
        data.pop()
        if len(data) % 2 == 0:
            half = int(len(data) / 2)
            if data[:half] == data[half:]:
                print("".join(data[:half]))
                break

Submission status: Wrong Answer

Solution code:
import sys

n = int(raw_input())
a_list = [int(i) for i in raw_input().split()]

# n = 9                                                                                                                                                                                                                                       
# a_list = [1,2,3,4,5,6,7,8,9]                                                                                                                                                                                                                

print n, a_list
b_list = [0] * n

for i in range(n):
    if n % 2 == 0:
        if i % 2 == 0:
            idx = int(n / 2) + i/2
        else:
            idx = int(n / 2) - i/2 - 1
    else:
        if i % 2 != 0:
            idx = int(n / 2) + i/2 + 1
        else:
            idx = int(n / 2) - i/2
    b_list[idx] = a_list[i]
    print a_list[i], idx


# 1                                                                                                                                                                                                                                           
# 2,1                                                                                                                                                                                                                                         
# 3,1,2                                                                                                                                                                                                                                       
# 4,2,1,3                                                                                                                                                                                                                                     
# 5,3,1,2,4                                                                                                                                                                                                                                   
# 6,4,2,1,3,5                                                                                                                                                                                                                                 
# 7,5,3,1,2,4,6                                                                                                                                                                                                                               
# 8,6,4,2,1,3,5,7                                                                                                                                                                                                                             
# 9,7,5,3,1,2,4,6,8                                                                                                                                                                                                                           

ans = ''
for b in b_list:
    ans += '{} '.format(b)
ans = ans.rstrip()

print ans

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = []
move = 0
center = n//2

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


print(' '.join(ans))

Submission status: Wrong Answer

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

ans = []
move = 0
center = n//2

for z in range(n):
        ans.append(a[z])
        ans.reverse()

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(raw_input())

A = raw_input().split(" ")

Even = []
Odd = []

for i in range(N):
	if (i+1) % 2 == 0:
		Even.append(A[i])


	else:
		Odd.append(A[i])

if N % 2 == 1:
	ans = Odd[::-1]
	for i in Even:
		ans.append(i)

else:
	ans = Even[::-1]
	for i in Odd:
		ans.append(i)

print ans

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [int(i) for i in input().split()]
b = []
for j in range(n):
    b.append(a[j])
    b = b[::-1]

for i in range(n):
    c = b[i]

print(c)

Submission status: Wrong Answer

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

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

if n%2 == 1:
    b.append(a[n-1])
    b.reverse

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

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
n = int(input())
ary = list(map(int, input().split()))

print(ary)
out = []
for i in range(n):
	out.append(ary[i])
	out.reverse()

out = list(map(str, out))
print(" ".join(out))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=input().split()
for i in range(n):
        if n > 0: 
                print(a[n-1],end="")
                n=n-2
                if n == 0 or n == -1:
                        n=n-1
        elif n < 0: 
                print(a[-1*n-1],end="")
                n=n-2
print("")

Submission status: Wrong Answer

Solution code:
def reverse_append(nums):
    ans = [0] * len(nums)
    left = False
    right_i = len(nums) // 2
    left_i = right_i - 1
    for i in range(len(nums)):
        if left:
            left = not left
            ans[left_i] = nums[i]
            left_i -= 1
        else:
            left = not left
            ans[right_i] = nums[i]
            right_i += 1
    return ans



if __name__ == "__main__":
    raw_input()
    nums = [int(i) for i in raw_input().split()]
    print(" ".join([str(num) for num in reverse_append(nums)]))

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline())
a = [x for x in sys.stdin.readline().split()]
b = [a[i] for i in range(n) if i % 2 != 0]
rb = b[::-1]
c = [a[i] for i in range(n) if i % 2 == 0]
rc = c[::-1]
if n % 2 == 0:
    ans = rb + c
else:
    ans = rc + b
ans = " ".join(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
even = n%2
ans = []
s = list(map(int,(input().split())))
for i in range(n):
    if i%2 == even:#i と n の偶奇が一致していれば、数列の前に ai を追加する。
        ans.insert(0,s[i])
    else:
        ans.append(s[i])
print(" ".join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

inp = map(int, raw_input().split())
n = len(inp)
ans = []

for i, j in enumerate(inp):
    if i % 2 == (n -1) %2:
        ans.insert(0, j)
    else:
        ans.insert(len(ans), j)

for i in ans: print(i),

Submission status: Wrong Answer

Solution code:
print("")

Submission status: Wrong Answer

Solution code:
quant = int(input())
nums = list(map(int, input().split()))
data = []

for i in range(quant):
    if i % 2 == 0:
        data.append(nums[i])
    else:
        data.insert(0, nums[i])

if quant % 2 == 0:
        for i in data:
            print(i, end=" ")
else:
    for i in reversed(range(quant)):
        print(data[i], end=" ")

print("\b")

Submission status: Wrong Answer

Solution code:
quant = int(input())
nums = list(map(int, input().split()))
data = []

for i in range(quant):
    if i % 2 == 0:
        data.append(nums[i])
    else:
        data.insert(0, nums[i])

if quant % 2 == 0:
        for i in data:
            print(i, end=" ")
else:
    for i in reversed(range(quant)):
        print(data[i], end=" ")

print("\b")

Submission status: Wrong Answer

Solution code:
n = int(input())
b = []
flag = 1
x = ''
y = ''
a = list(map(str, input().split()))
if n == 1:
    print(a[0])
    exit()
for i in range(n//2):
    if x == '':
        x = a[i*2]
    else:
        x += ' ' + a[i * 2]
    if y == '':
        y = a[i*2+1]
    else:
        y += ' ' + a[i*2+1]
if n % 2 != 0:
    x += ' ' + a[-1]
if n % 2 == 0:
    print(y[::-1] + ' ' + x)
else:
    print(x[::-1] + ' ' + y)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    # if len(s) % 2:
    #     print(" ".join(s1)[::-1] +" "+ " ".join(s2))
    # else:
    print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2 == 1:
        print(" ".join(s1)[::-1] +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Submission status: Wrong Answer

Solution code:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s1) != len(s2):
        print(" ".join(s1)[::-1] +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
A = input()
a = list(map(int,A.split(" ")))
a = np.array(a)
odd = a[1::2]
even = a[0::2]
if n%2 == 0:
    b = np.append(even[::-1],odd)
else:
    b = np.append(odd[::-1],even)
 
import sys
for d in b[:-1]:
    sys.stdout.write(str(d)+ " ")
sys.stdout.write(str(b[-1])+"\n")

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
A = input()
a = list(map(int,A.split(" ")))
a = np.array(a)
odd = a[1::2]
even = a[0::2]
if n//2 == 0:
    b = np.append(even[::-1],odd)
else:
    b = np.append(odd[::-1],even)
import sys
for d in b[:-1]:
    sys.stdout.write(str(d)+ " ")
sys.stdout.write(str(b[-1])+"\n")

Submission status: Wrong Answer

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

ans_list = []

i = 0
while i < n:
    if i % 2 == 0:
        ans_list. append(a[i])
    else:
        ans_list.insert(0, a[i])
    i += 1

ans_s = ""

i = 0
while i < n:
    if i == n -1:
        ans_s = ans_s + ans_list[i]
    else:
        ans_s = ans_s + ans_list[i] + " "
    i += 1

print(ans_s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
    tmp = int(n_list[0])
    n_list.pop(0)
    new_list.append(tmp)
    new_list.reverse()

print(new_list)

Submission status: Wrong Answer

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

if (n % 2 == 0) :
  b[n // 2] =a[0]
  b[0] = a[n - 1]
  for i in range(n//2 - 1) :
    b[(n // 2) - i - 1] = a[2 * i + 1]
    b[(n // 2) + i + 1] = a[2 * (i+1)]
  for i in range(n) :
    print(b[i], end = '')
  print()

if (n % 2 == 1) :
  b[n // 2] =a[0]
  for i in range(n//2) :
    b[(n // 2) + i + 1] = a[2 * i + 1]
    b[(n // 2) - i - 1] = a[2 * (i+1)]
  for i in range(n) :
    print(b[i], end = '')
  print()

Submission status: Wrong Answer

Solution code:

n = int(input())
abc = input().split(' ')
b = str(abc[0])

for i in range(1, n):
    if i%2 != 0:
        b= abc[i] + ' ' + b
    else:
        b += ' '  +  abc[i]
    
print(b)
#for i in b:
 #   print(i, end=' ')

Submission status: Wrong Answer

Solution code:

n = int(input())
abc = input().split(' ')
b = [abc[0]]

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

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

Submission status: Wrong Answer

Solution code:
_ = input()
a = input().split()
a1 = list(reversed(a[1::2]))
a2 = a[::2]
print(" ".join(a1 + a2))

Submission status: Wrong Answer

Solution code:

n = int(input())
abc = input().split(' ')
b = ()

for i in abc:
    b += tuple(i)
    b = b[::-1]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
b = []
flag = 0
for i in input().split():
    if flag > 0:
        ans = ans + ' ' + i
    elif flag < 0:
        ans = i + ' ' + ans
    else:
        ans = str(i)
        flag = 1
    flag *= -1
if flag < 0:
    print(ans[::-1])
else:
    print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 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 = [0]*n

if (n%2) == 0:
    for i in range(n):
        if(i<(n//2)):
            b[i] = a[n-(2*i)-1]
        else:
            b[i] = a[(i-(n//2)-1)*2]
else:
    for i in range(n):
        if(i<(n//2)):
            b[i] = a[n-(2*i)-1]
        elif i == (n//2):
            b[i]= a[0]
        else:
            b[i] = a[(i-(n//2)-1)*2+1]


print(" ".join([i for i in b]))

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
a=input().split()
b=[0 for _ in range(N)]
for i in range(0,int(N/2)+2,2):
    b[int(i/2)]=a[N-i-1]
    b[N-int(i/2)-1]=a[N-i-2]
if(N%2==1):
    b[int(N/2)]=a[0]
for index,item in enumerate(b):
    if(index==len(b)-1):
        break
    sys.stdout.write(str(item)+" ")
sys.stdout.write(str(b[N-1])+"\n")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
  b = str(a[i]) + b[::-1]

print(' '.join(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
even = 0
if n % 2 == 0:
    even = 1

el = []
ol = []
#n偶数のとき逆順奇数列＋普通の偶数列
s = list(map(int,(input().split())))
for i in range(n):
    if i%2 ==0:#guusuu
        el.append(s[i])
    else:
        ol.append(s[i])
if even == 1:#偶数のとき
    ol.reverse()
    ans = ol.extend(el)
    print(ol)
else:
    el.reverse()
    ans = el.extend(ol)
    print(el)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

n = map(int, raw_input())
dt = map(int, raw_input().split())
ans = []

for i in dt:
  ans.append(i)
  ans.reverse()
print(ans)

Submission status: Wrong Answer

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

#N = 6
#a = [0,6 ,7 ,6, 7 ,0]
b = []

for i in range(0,N):
	b.append(a[i])
	b.reverse()
	
print(b)

Submission status: Wrong Answer

Solution code:
#Python

N= input()
#print N
a = map(int, raw_input().split())
#print a


b=[]
for i in range(N):
	b.append(a[i])
	b.reverse()
	#print b


print b

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python

n = map(int, raw_input())

dt = [i for i in map(int, raw_input().split())]
ans = []

for i in dt:
  ans.append(i)
  ans.reverse()
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l = []
for i in map(int, input().split()):
    l.append(i)
    l.reverse()
print(' '.join(map(str, l)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    n = get_ln_int_inputs()[0]
    a = get_ln_int_inputs()

    ilist = []

    t = n
    while t > 0:
        ilist.append(t)
        t -= 2
    if t == -1:
        t = 2
    else:
        t = 1
    while t < n:
        ilist.append(t)
        t += 2
    
    print(ilist)
    print(" ".join(str(a[i - 1]) for i in ilist))


main()

Submission status: Wrong Answer

Solution code:

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

b = []
c = []
for i in range(len(a)):
    if i % 2 == 1:
        b.append(a[i])
    else:
        c.append(a[i])

b.reverse()
b += c

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    n = get_ln_int_inputs()[0]
    a = get_ln_int_inputs()

    ilist = []

    t = n
    while t > 0:
        ilist.append(t)
        t -= 2
    t += 1
    while t < n:
        ilist.append(t)
        t += 2
    
    print(" ".join(str(a[i - 1]) for i in ilist))


main()