結果
| 問題 |
No.27 板の準備
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-05 16:06:41 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 54 ms / 5,000 ms |
| コード長 | 571 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-10-14 01:18:43 |
| 合計ジャッジ時間 | 1,682 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
#!/usr/bin/env python3
# %%
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.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)
# %%
answer = min(solve(A, B, C) for A, B, C in itertools.combinations(range(1, 31), 3))
print(answer)
maspy