結果

問題 No.27 板の準備
ユーザー ayame_pyayame_py
提出日時 2015-10-09 15:27:26
言語 Python2
(2.7.18)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 455 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 6,524 KB
実行使用メモリ 6,116 KB
最終ジャッジ日時 2023-08-27 04:08:48
合計ジャッジ時間 3,471 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
6,080 KB
testcase_01 AC 125 ms
6,004 KB
testcase_02 AC 124 ms
6,092 KB
testcase_03 AC 125 ms
5,936 KB
testcase_04 AC 125 ms
5,860 KB
testcase_05 AC 125 ms
5,968 KB
testcase_06 AC 124 ms
6,052 KB
testcase_07 AC 125 ms
6,072 KB
testcase_08 AC 126 ms
6,000 KB
testcase_09 AC 124 ms
6,092 KB
testcase_10 AC 126 ms
5,992 KB
testcase_11 AC 124 ms
5,932 KB
testcase_12 AC 124 ms
5,880 KB
testcase_13 AC 124 ms
5,944 KB
testcase_14 AC 124 ms
5,940 KB
testcase_15 AC 124 ms
5,952 KB
testcase_16 AC 123 ms
5,956 KB
testcase_17 AC 123 ms
6,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
V = map(int, raw_input().split())
INF = int(1e9+7)
ans = INF
for a in range(1,31):
	for b in range(a,31):
		for c in range(b,31):
			dp = [INF for _ in range(31)]
			dp2 = [[0, 0 ,0], ]
			dp[0] = 0
			for i in range(1,31):
				at = INF if i - a < 0 else dp[i-a]
				bt = INF if i - b < 0 else dp[i-b]
				ct = INF if i - c < 0 else dp[i-c]
				dp[i] = min(at, bt, ct) + 1
			ans = min(ans, dp[V[0]]+dp[V[1]]+dp[V[2]]+dp[V[3]])

print ans
0