[Python/2017] Move solutions into .py files
This commit is contained in:
parent
fbc5fda60f
commit
7b1efc0d9c
51 changed files with 1100 additions and 4546 deletions
22
Python/2017/17.py
Normal file
22
Python/2017/17.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from lib import *
|
||||
|
||||
input = read_input(2017, 17)
|
||||
|
||||
|
||||
n = int(input)
|
||||
lst = [0]
|
||||
pos = 0
|
||||
for i in range(1, 2018):
|
||||
pos = (pos + n) % len(lst) + 1
|
||||
lst.insert(pos, i)
|
||||
print(lst[(lst.index(2017) + 1) % len(lst)])
|
||||
|
||||
|
||||
k = int(input)
|
||||
i = 0
|
||||
last = None
|
||||
for j in range(1, 50000000 + 1):
|
||||
i = (i + k) % j + 1
|
||||
if i == 1:
|
||||
last = j
|
||||
print(last)
|
Loading…
Add table
Add a link
Reference in a new issue