結果

問題 No.1770 N言っちゃダメゲーム (6)
ユーザー KudeKude
提出日時 2021-12-02 06:59:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 87,240 KB
実行使用メモリ 91,800 KB
最終ジャッジ日時 2023-09-18 10:09:20
合計ジャッジ時間 7,161 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,268 KB
testcase_01 AC 95 ms
71,772 KB
testcase_02 AC 94 ms
71,664 KB
testcase_03 AC 98 ms
71,428 KB
testcase_04 AC 94 ms
71,596 KB
testcase_05 AC 94 ms
71,576 KB
testcase_06 AC 106 ms
78,600 KB
testcase_07 AC 108 ms
78,556 KB
testcase_08 AC 92 ms
71,460 KB
testcase_09 AC 92 ms
71,592 KB
testcase_10 AC 116 ms
79,200 KB
testcase_11 AC 114 ms
78,628 KB
testcase_12 AC 116 ms
79,200 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 93 ms
71,752 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 91 ms
71,772 KB
testcase_20 WA -
testcase_21 AC 91 ms
71,696 KB
testcase_22 AC 91 ms
71,576 KB
testcase_23 AC 104 ms
77,248 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 120 ms
78,644 KB
testcase_29 AC 112 ms
77,788 KB
testcase_30 WA -
testcase_31 AC 110 ms
77,576 KB
testcase_32 AC 134 ms
90,132 KB
testcase_33 WA -
testcase_34 AC 135 ms
89,976 KB
testcase_35 AC 142 ms
91,332 KB
testcase_36 AC 137 ms
91,356 KB
testcase_37 AC 138 ms
90,732 KB
testcase_38 AC 113 ms
79,108 KB
testcase_39 AC 114 ms
78,908 KB
testcase_40 AC 114 ms
78,792 KB
testcase_41 AC 111 ms
78,912 KB
testcase_42 AC 113 ms
78,840 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 135 ms
91,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0