Skip to content

Instantly share code, notes, and snippets.

@drygdryg
Created December 30, 2019 10:04
Show Gist options
  • Save drygdryg/74060cb46ed3d007ccc8eb9b528cc418 to your computer and use it in GitHub Desktop.
Save drygdryg/74060cb46ed3d007ccc8eb9b528cc418 to your computer and use it in GitHub Desktop.
Решение задачи C городской олимпиады по информатике (г. Луганск, 2019 г.)
n, k = map(int, input().split())
table = [[True]*n, [False]*n]
for i in range(2, n + 1):
table.append([])
for j in range(n):
temp = True
m = i if (j + 2) > i else (j + 2)
for s in range(m):
temp &= table[i-s-1][s]
table[i].append(not temp)
answer = []
for i in range(k):
if not table[n-i-1][i]:
answer.append(i+1)
if answer:
print(*answer)
else:
print(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment