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 -

python - Error: Unresolved reference 'selenium' What is the reason? -

php - Need to store a large amount of data in session with CI 3 but on storing large data in session it is itself destorying automatically -