結果

問題 No.115 遠足のおやつ
ユーザー TawaraTawara
提出日時 2015-09-16 01:21:25
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 6,668 KB
実行使用メモリ 6,140 KB
最終ジャッジ日時 2023-09-26 12:07:23
合計ジャッジ時間 5,430 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,856 KB
testcase_01 AC 13 ms
5,868 KB
testcase_02 WA -
testcase_03 AC 12 ms
6,008 KB
testcase_04 WA -
testcase_05 AC 12 ms
5,912 KB
testcase_06 AC 11 ms
6,084 KB
testcase_07 AC 14 ms
5,960 KB
testcase_08 AC 11 ms
5,832 KB
testcase_09 AC 11 ms
5,960 KB
testcase_10 AC 11 ms
5,908 KB
testcase_11 AC 11 ms
5,960 KB
testcase_12 AC 11 ms
6,076 KB
testcase_13 AC 11 ms
5,828 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 79 ms
5,948 KB
testcase_18 AC 12 ms
5,920 KB
testcase_19 AC 27 ms
5,864 KB
testcase_20 AC 21 ms
6,040 KB
testcase_21 AC 11 ms
5,960 KB
testcase_22 WA -
testcase_23 AC 15 ms
5,928 KB
testcase_24 WA -
testcase_25 AC 87 ms
5,896 KB
testcase_26 AC 30 ms
6,020 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 44 ms
5,980 KB
testcase_30 WA -
testcase_31 AC 30 ms
6,036 KB
testcase_32 WA -
testcase_33 AC 19 ms
5,840 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 385 ms
6,064 KB
testcase_40 AC 11 ms
5,828 KB
testcase_41 AC 12 ms
5,916 KB
testcase_42 AC 12 ms
5,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D,K = map(int,raw_input().split())
dp = [None]*(D+1+N)
dp[0] = []
for i in xrange(K):
	for j in reversed(xrange(D)):
		if dp[j] == None:
			continue
		for k in xrange(1,N+1):
			if k in dp[j]:
				continue
			tmpv = dp[j] + [k]
			if dp[j+k] is None or not (len(tmpv) <= len(dp[j+k]) and tmpv >= dp[j+k]):
				dp[j+k] = tmpv
print -1 if dp[D] == None or len(dp[D]) != K else " ".join(map(str,dp[D]))
0