I'm trying to pass a code in SPOJ ( link ) to solve a very simple problem: Read an array, read matrix coordinates, and verify that the same coordinate has been read twice. If yes, print 1. If not, print 0.
I'm getting the error: Run-time error (NZEC).
The code:
import sys
import psyco
psyco.full()
def main():
matriz = [[]]
i = 0
j = 0
repetido = False
x = 0
y = 0
n = 0
#sys.stdin.readline()
for i in range(530):
for j in range(530):
matriz[i].append(0)
matriz.append([])
del matriz[530]
n = int(raw_input())
for i in range(n):
gamb = raw_input().split();
x = int(gamb[0])
y = int(gamb[1])
if matriz[x][y] == 1:
repetido = True
else:
matriz[x][y] = 1
if repetido:
print "1"
else:
print "0"
main()
What could cause this kind of error? Thanks!