Puzzle du 17 décembre 2017
This commit is contained in:
parent
f51f9725ef
commit
7e0dff3d0b
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
steps = int(sys.argv[1])
|
||||
buff, pos = [0], 0
|
||||
for i in range(1, 2018):
|
||||
pos = (pos + steps) % len(buff) + 1
|
||||
buff.insert(pos, i)
|
||||
print(buff[buff.index(2017) + 1])
|
||||
buff, pos = [], 0
|
||||
for i in range(1, 50000001):
|
||||
pos = (pos + steps) % i + 1
|
||||
if pos == 1:
|
||||
buff.append(i)
|
||||
print(buff[-1])
|
Loading…
Reference in New Issue