This is a CodeChef problem for the November challenge. I donot intend to cheat. My program works well for the test input provided. But the server generates a runtime NZEC error.
Can you help me identify my mistake?
T= raw_input()
for i in xrange(int(T)):
G= raw_input()
for j in xrange(int(G)):
I, N, Q = raw_input().split()
I= int(I)
N= int(N)
Q= int(Q)
a= [I]*N
print a
count=0
for k in xrange(N):
if((N-k) % 2 != 0):
if a[k]==1:
a[k]=2
else: a[k]=1
print a
for k in xrange(N):
if( a[k] == Q):
count= count+1
print count
Thank you very much.
The problem description says that N can be
10**9. Soa= [I]*Nmight require several gigabytes of memory. Your program probably terminates with MemoryError exception that leads to non-zero exit status (1).