Getting runtime error on the " Sorted Adjacent Differences"

Revision en3, by Hot_Potato, 2020-04-12 20:32:48

https://codeforces.com/problemset/problem/1339/B Hello, i am getting runtime error on this...Can anyone help me out..when i test samples on my own laptop, it is working out fine!!

T = int(input())

for s in range(1,T+1):

N = int(input())

l = [int(input()) for i in range(N)]

l.sort()

p = []

x = len(l)

while (len(l)>2):

    p = [l[0],l[-1]] + p

    l = l[1:-1]

p = l + p


print(*p,sep=" ")
Tags runtime error, #a easy question, #sorting, #constructive algorithms

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Hot_Potato 2020-04-12 20:32:48 20 (published)
en2 English Hot_Potato 2020-04-12 20:31:54 1 (saved to drafts)
en1 English Hot_Potato 2020-04-12 20:31:14 512 Initial revision (published)