結果
| 問題 |
No.27 板の準備
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-13 01:02:33 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 5,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2025-06-13 01:02:36 |
| 合計ジャッジ時間 | 2,471 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
import sys
read=sys.stdin.buffer.read
readline=sys.stdin.buffer.readline
V=list(map(int,readline().split()))
from itertools import combinations
def solve(A, B, C):
INF=10**9
dp=[INF]*31
dp[0]=0
for val in [A, B, C]:
for n in range(31-val):
dp[n+val]=min(dp[n+val], dp[n]+1)
return sum(dp[v] for v in V)
ans=min(solve(A, B, C) for (A,B,C) in combinations(range(1,31), 3))
print(ans, flush=True)