結果

問題 No.115 遠足のおやつ
ユーザー c_r_5c_r_5
提出日時 2018-09-07 18:32:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 295 ms / 5,000 ms
コード長 412 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 9,232 KB
最終ジャッジ日時 2023-08-31 00:47:30
合計ジャッジ時間 3,557 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,796 KB
testcase_01 AC 37 ms
8,280 KB
testcase_02 AC 22 ms
7,816 KB
testcase_03 AC 19 ms
8,324 KB
testcase_04 AC 67 ms
8,588 KB
testcase_05 AC 16 ms
7,832 KB
testcase_06 AC 16 ms
7,808 KB
testcase_07 AC 17 ms
7,752 KB
testcase_08 AC 27 ms
7,896 KB
testcase_09 AC 39 ms
8,328 KB
testcase_10 AC 43 ms
8,336 KB
testcase_11 AC 18 ms
7,868 KB
testcase_12 AC 24 ms
7,796 KB
testcase_13 AC 16 ms
7,956 KB
testcase_14 AC 19 ms
7,924 KB
testcase_15 AC 49 ms
8,284 KB
testcase_16 AC 53 ms
8,388 KB
testcase_17 AC 25 ms
7,944 KB
testcase_18 AC 16 ms
7,752 KB
testcase_19 AC 17 ms
7,852 KB
testcase_20 AC 18 ms
7,824 KB
testcase_21 AC 18 ms
7,796 KB
testcase_22 AC 49 ms
8,212 KB
testcase_23 AC 29 ms
8,320 KB
testcase_24 AC 51 ms
8,284 KB
testcase_25 AC 25 ms
7,768 KB
testcase_26 AC 19 ms
7,852 KB
testcase_27 AC 24 ms
7,892 KB
testcase_28 AC 22 ms
7,828 KB
testcase_29 AC 21 ms
7,796 KB
testcase_30 AC 48 ms
8,352 KB
testcase_31 AC 25 ms
7,956 KB
testcase_32 AC 49 ms
8,224 KB
testcase_33 AC 16 ms
7,920 KB
testcase_34 AC 69 ms
8,540 KB
testcase_35 AC 33 ms
7,808 KB
testcase_36 AC 53 ms
8,228 KB
testcase_37 AC 48 ms
8,280 KB
testcase_38 AC 278 ms
9,232 KB
testcase_39 AC 295 ms
9,180 KB
testcase_40 AC 16 ms
7,924 KB
testcase_41 AC 15 ms
7,756 KB
testcase_42 AC 16 ms
7,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K=map(int,input().split())
dp=[[[]for __ in range(D+1)]for _ in range(K+1)]
for i in range(1,K+1):
    for j in range(1,D+1):
        for k in range(1,N+1):
            if j-k<0:continue
            if not k in dp[i-1][j-k] and len(dp[i-1][j-k])==i-1 and sum(dp[i-1][j-k])+k==j:
                dp[i][j]=dp[i-1][j-k]+[k]
                break
if dp[K][D]==[]:
    print(-1)
else:
    print(*sorted(dp[K][D]))
0