結果
| 問題 |
No.1770 N言っちゃダメゲーム (6)
|
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2021-12-02 06:59:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 517 bytes |
| コンパイル時間 | 164 ms |
| コンパイル使用メモリ | 82,284 KB |
| 実行使用メモリ | 92,544 KB |
| 最終ジャッジ日時 | 2024-07-05 01:47:11 |
| 合計ジャッジ時間 | 4,579 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 WA * 15 |
ソースコード
from collections import deque
n, k = map(int, input().split())
wins = deque()
win_others = [[] for _ in range(n)]
for i in range(n - 1, 0, -1):
cnt = len(wins) + len(win_others[i])
if cnt == 0:
wins.appendleft(i)
elif cnt == 1:
j = wins[0] if wins else win_others[i][0]
p = i - (j - i)
if p >= 0:
win_others[p].append(i)
if wins and wins[-1] == i + k:
wins.pop()
ans = win_others[0] + list(wins)
if ans:
print(*ans, sep='\n')
else:
print(0)
Kude