-
-
Save drygdryg/74060cb46ed3d007ccc8eb9b528cc418 to your computer and use it in GitHub Desktop.
Решение задачи C городской олимпиады по информатике (г. Луганск, 2019 г.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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