21 lines
381 B
Python
Executable file
21 lines
381 B
Python
Executable file
#!/usr/bin/python
|
|
|
|
from sys import argv
|
|
|
|
mem = [{}, {}]
|
|
|
|
def flip(x, y):
|
|
if y not in mem[x]:
|
|
mem[x][y] = 1
|
|
else:
|
|
mem[x][y] = 1 - mem[x][y]
|
|
return mem[x][y]
|
|
|
|
with open(argv[1]) as f:
|
|
for line in f.readlines():
|
|
l = list(map(int, line.split()))
|
|
x = l[0]
|
|
for i in range(1, len(l)):
|
|
x = flip(x, l[i])
|
|
print(x)
|