Here we go again
This commit is contained in:
parent
9bfa5ac661
commit
968a9786a8
|
@ -0,0 +1,3 @@
|
|||
import fileinput
|
||||
|
||||
print(eval(''.join(map(str.strip, fileinput.input()))))
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env python3
|
||||
import fileinput
|
||||
import itertools
|
||||
|
||||
|
||||
def main():
|
||||
x = 0
|
||||
found = {x}
|
||||
|
||||
for line in itertools.cycle(map(str.strip, fileinput.input())):
|
||||
x = eval('x{}'.format(line))
|
||||
if x in found:
|
||||
return x
|
||||
found.add(x)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(main())
|
Loading…
Reference in New Issue