結果

問題 No.115 遠足のおやつ
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-08-05 09:40:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 86,632 KB
実行使用メモリ 77,964 KB
最終ジャッジ日時 2023-09-25 15:59:22
合計ジャッジ時間 6,027 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,492 KB
testcase_01 AC 77 ms
75,476 KB
testcase_02 WA -
testcase_03 AC 77 ms
75,768 KB
testcase_04 WA -
testcase_05 AC 72 ms
71,532 KB
testcase_06 AC 71 ms
71,480 KB
testcase_07 AC 77 ms
76,688 KB
testcase_08 AC 71 ms
71,408 KB
testcase_09 AC 72 ms
71,380 KB
testcase_10 AC 72 ms
71,292 KB
testcase_11 AC 70 ms
71,360 KB
testcase_12 AC 72 ms
71,144 KB
testcase_13 AC 73 ms
71,456 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 98 ms
77,392 KB
testcase_18 AC 71 ms
71,200 KB
testcase_19 AC 82 ms
76,268 KB
testcase_20 AC 79 ms
76,640 KB
testcase_21 AC 73 ms
71,480 KB
testcase_22 WA -
testcase_23 AC 77 ms
75,484 KB
testcase_24 WA -
testcase_25 AC 94 ms
76,520 KB
testcase_26 AC 88 ms
76,448 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 91 ms
76,844 KB
testcase_30 WA -
testcase_31 AC 83 ms
76,484 KB
testcase_32 WA -
testcase_33 AC 79 ms
76,668 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 109 ms
77,320 KB
testcase_40 AC 73 ms
71,548 KB
testcase_41 AC 72 ms
71,436 KB
testcase_42 AC 74 ms
71,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, d, k = map(int, input().split())

dp = [[None] * (d + 1) for _ in range(k + 1)]
dp[0][0] = (0, )
for x in range(k):
    for y in range(d):
        last = dp[x][y]
        if last is None:
            continue

        for z in range(last[-1] + 1, n + 1):
            if y + z <= d:
                if dp[x + 1][y + z] is None:
                    dp[x + 1][y + z] = (*last, z)
                else:
                    dp[x + 1][y + z] = min(dp[x + 1][y + z], (*last, z))

ans = dp[k][d]
if ans is None:
    print(-1)
else:
    print(*ans[1:])
0