Circular rotation of a list in python: terminated due to timeout -


i have tried circulation rotation of list a , tried print elements of list, program getting terminated when test cases used large numbers n, k, q.

n,k,q = raw_input().strip().split(' ') n,k,q = [int(n),int(k),int(q)] = map(int,raw_input().strip().split(' ')) b=list(a) a0 in xrange(q):     m = int(raw_input().strip())      j in xrange(k):         #print         l=a[n-1]         in range(n-2,-1,-1):             a[i+1] = a[i]         a[0] = l     print a[m]     a=list(b) 


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -