結果
| 問題 |
No.27 板の準備
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-23 00:37:37 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 52 ms / 5,000 ms |
| コード長 | 462 bytes |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-23 00:37:39 |
| 合計ジャッジ時間 | 2,437 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
import itertools
*V, = map(int, read().split())
def solve(A, B, C):
INF = 100
dp = [INF] * 31
dp[0] = 0
for value in [A, B, C]:
for n in range(31 - value):
x = dp[n] + 1
if dp[n + value] > x:
dp[n + value] = x
return sum(dp[v] for v in V)
ans = min(solve(A, B, C) for A, B, C in itertools.combinations(range(1, 31), 3))
print(ans)