結果

問題 No.1770 N言っちゃダメゲーム (6)
ユーザー chineristACchineristAC
提出日時 2021-12-02 15:48:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 170 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 86,480 KB
実行使用メモリ 132,396 KB
最終ジャッジ日時 2023-09-18 10:19:25
合計ジャッジ時間 7,170 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,732 KB
testcase_01 AC 72 ms
71,020 KB
testcase_02 AC 71 ms
71,084 KB
testcase_03 AC 72 ms
70,988 KB
testcase_04 AC 72 ms
71,036 KB
testcase_05 AC 72 ms
71,024 KB
testcase_06 AC 132 ms
113,236 KB
testcase_07 AC 131 ms
113,748 KB
testcase_08 AC 72 ms
70,732 KB
testcase_09 AC 72 ms
71,068 KB
testcase_10 AC 134 ms
110,220 KB
testcase_11 AC 135 ms
110,452 KB
testcase_12 AC 136 ms
109,916 KB
testcase_13 AC 71 ms
71,060 KB
testcase_14 AC 71 ms
71,024 KB
testcase_15 AC 71 ms
71,024 KB
testcase_16 AC 72 ms
71,272 KB
testcase_17 AC 88 ms
76,320 KB
testcase_18 AC 71 ms
71,128 KB
testcase_19 AC 71 ms
70,592 KB
testcase_20 AC 72 ms
71,188 KB
testcase_21 AC 71 ms
71,092 KB
testcase_22 AC 70 ms
71,188 KB
testcase_23 AC 81 ms
75,852 KB
testcase_24 AC 78 ms
76,128 KB
testcase_25 AC 83 ms
76,208 KB
testcase_26 AC 84 ms
75,816 KB
testcase_27 AC 81 ms
75,848 KB
testcase_28 AC 143 ms
111,260 KB
testcase_29 AC 105 ms
86,916 KB
testcase_30 AC 143 ms
111,944 KB
testcase_31 AC 104 ms
86,848 KB
testcase_32 AC 155 ms
117,168 KB
testcase_33 AC 148 ms
112,552 KB
testcase_34 AC 170 ms
132,396 KB
testcase_35 AC 151 ms
115,520 KB
testcase_36 AC 152 ms
112,872 KB
testcase_37 AC 157 ms
117,468 KB
testcase_38 AC 155 ms
117,352 KB
testcase_39 AC 153 ms
117,432 KB
testcase_40 AC 154 ms
117,136 KB
testcase_41 AC 153 ms
117,600 KB
testcase_42 AC 151 ms
117,352 KB
testcase_43 AC 156 ms
116,176 KB
testcase_44 AC 140 ms
112,812 KB
testcase_45 AC 156 ms
116,712 KB
testcase_46 AC 146 ms
112,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())

dp = [set() for i in range(N)]
for i in range(N):
    if not dp[i]:
        for j in range(i+1,min(i+K+1,N)):
            dp[j].add(j-i)
    elif len(dp[i])==1:
        for k in dp[i]:
            if i+k < N:
                dp[i+k].add(k)

#print(dp)
if dp[N-1]:
    dp[N-1] = sorted(dp[N-1])
    print(*dp[N-1],sep="\n")
else:
    print(0)

    
0