結果

問題 No.27 板の準備
ユーザー tookunn_1213tookunn_1213
提出日時 2016-09-16 22:06:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 170 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 11,012 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-08-27 04:35:59
合計ジャッジ時間 4,029 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
7,872 KB
testcase_01 AC 160 ms
7,920 KB
testcase_02 AC 163 ms
7,836 KB
testcase_03 AC 157 ms
7,844 KB
testcase_04 AC 162 ms
7,820 KB
testcase_05 AC 164 ms
7,920 KB
testcase_06 AC 158 ms
7,872 KB
testcase_07 AC 166 ms
7,856 KB
testcase_08 AC 159 ms
7,776 KB
testcase_09 AC 170 ms
7,820 KB
testcase_10 AC 160 ms
7,816 KB
testcase_11 AC 158 ms
7,860 KB
testcase_12 AC 165 ms
7,788 KB
testcase_13 AC 158 ms
7,784 KB
testcase_14 AC 170 ms
7,788 KB
testcase_15 AC 162 ms
7,868 KB
testcase_16 AC 162 ms
7,956 KB
testcase_17 AC 164 ms
7,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

v=list(map(int,input().split()))
s=31
for a in range(1,31):
	for b in range(a,31):
		for c in range(b,31):
			d=[31]*31
			d[0]=0
			for i in range(30):
				if i+a<=30:
					d[i+a]=min(d[i+a],d[i]+1)
				if i+b<=30:
					d[i+b]=min(d[i+b],d[i]+1)
				if i+c<=30:
					d[i+c]=min(d[i+c],d[i]+1)
			s=min(s,sum([d[v[i]] for i in range(4)]))
print(s)
0