Why i am getting NZEC Error In python?

I don’t know why i am getting this NZEC Error, it was working fine in my local computer but it was throwing this error while submitting my solution.
My Solution: https://www.codechef.com/viewsolution/46476324
Have A look at it.
Thanks.

I get “Access Denied” when I click on that link.

you are able to run it in your machine because there is no memory allocation limit but here in questions there is a memory limit associated with every question and your program might using more memory than it should be i.e try to reduce the space complexity of your program and it will get accepted :smiley: generally NZEC error raised because of memory limit exceed and one more thing we are not able to see the link you posted its throwing access denied so fix that :smiley:

I don’t how but I was able to access the link. Pasting the code here:

n = input()
cities = int(n)
passes = list(map(int, input().strip().split()))
passes.sort()
passes = list(set(passes))

li = []
li1 = []
for i in range(0,len(passes)):
	li2 = []
	for j in range(i, len(passes)):
		if (passes[j] not in li1) and ((passes[j] % passes[i]) == 0):
			li2.append(passes[j])
			li1.append(passes[j])
			
	if len(li2) > 0:
		li.append(li2)
	
print(len(li))

Edit: I know now that I was able to access the submission because the contest has ended. Thanks @ssjgz

Looks like they asked it while the Contest was still running - tsk tsk.

1 Like

ok