結果

問題 No.27 板の準備
ユーザー takakintakakin
提出日時 2020-05-27 23:28:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 174 ms / 5,000 ms
コード長 276 bytes
コンパイル時間 109 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-21 05:23:53
合計ジャッジ時間 3,873 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 174 ms
10,752 KB
testcase_01 AC 169 ms
10,752 KB
testcase_02 AC 169 ms
10,752 KB
testcase_03 AC 166 ms
10,624 KB
testcase_04 AC 158 ms
10,624 KB
testcase_05 AC 171 ms
10,752 KB
testcase_06 AC 163 ms
10,752 KB
testcase_07 AC 162 ms
10,752 KB
testcase_08 AC 162 ms
10,752 KB
testcase_09 AC 162 ms
10,624 KB
testcase_10 AC 167 ms
10,752 KB
testcase_11 AC 165 ms
10,752 KB
testcase_12 AC 159 ms
10,624 KB
testcase_13 AC 169 ms
10,752 KB
testcase_14 AC 164 ms
10,752 KB
testcase_15 AC 159 ms
10,752 KB
testcase_16 AC 164 ms
10,752 KB
testcase_17 AC 159 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

V=[int(i) for i in input().split()]
import itertools
inf=float("inf")
ans=inf
for A in itertools.combinations(range(1,31),3):
  D=[0]+[inf]*30
  for i in range(1,31):
    for a in A:
      if i>=a:
        D[i]=min(D[i],D[i-a]+1)
  ans=min(ans,sum(D[v] for v in V))
print(ans)
0