結果

問題 No.115 遠足のおやつ
ユーザー 👑 H20H20
提出日時 2020-12-04 15:02:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 76,728 KB
最終ジャッジ日時 2023-10-13 03:43:28
合計ジャッジ時間 6,939 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,408 KB
testcase_01 AC 82 ms
75,724 KB
testcase_02 WA -
testcase_03 AC 79 ms
75,748 KB
testcase_04 WA -
testcase_05 AC 75 ms
71,100 KB
testcase_06 AC 76 ms
71,264 KB
testcase_07 AC 80 ms
75,796 KB
testcase_08 AC 75 ms
71,288 KB
testcase_09 AC 75 ms
71,252 KB
testcase_10 AC 76 ms
71,420 KB
testcase_11 AC 74 ms
71,272 KB
testcase_12 AC 75 ms
71,208 KB
testcase_13 AC 74 ms
71,256 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 83 ms
76,472 KB
testcase_18 AC 78 ms
75,552 KB
testcase_19 AC 82 ms
76,384 KB
testcase_20 AC 82 ms
75,968 KB
testcase_21 AC 74 ms
71,116 KB
testcase_22 WA -
testcase_23 AC 81 ms
76,036 KB
testcase_24 WA -
testcase_25 AC 83 ms
76,272 KB
testcase_26 AC 83 ms
76,356 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 83 ms
75,928 KB
testcase_30 WA -
testcase_31 AC 82 ms
76,024 KB
testcase_32 WA -
testcase_33 AC 83 ms
75,760 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 92 ms
76,480 KB
testcase_40 AC 76 ms
71,428 KB
testcase_41 AC 75 ms
71,168 KB
testcase_42 AC 74 ms
71,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K = map(int,input().split())
DP = [[0] * (D+1) for i in range(K)]
for n in range(1,N+1):
    for k in reversed(range(K-1)):
        for i in range(D+1):
            if  i+n <= D and DP[k][i]!=0:
                DP[k+1][i+n]=n
    if n <= D:
        DP[0][n] = n
if DP[K-1][D]==0:
    print(-1)
    exit()
else:
    ANS = []
    temp = 0
    for i in reversed(range(K)):
        ANS.append(DP[i][D-temp])
        temp += DP[i][D-temp]

    ANS.sort()
    print(*ANS)
0