結果
| 問題 |
No.27 板の準備
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-13 14:18:30 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 544 ms / 5,000 ms |
| コード長 | 288 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 42,420 KB |
| 最終ジャッジ日時 | 2024-12-26 13:02:39 |
| 合計ジャッジ時間 | 7,883 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
コンパイルメッセージ
Syntax OK
ソースコード
V = gets.split.take(4).map(&:to_i)
$dp = {}
def f(v, a, b, c)
$dp[[v,a,b,c]] ||= if v < 0
1.0/0
elsif v == 0
0
else
[a, b, c].map{|d| f(v - d, a, b, c) }.min + 1
end
end
p [*1..30].combination(3).inject(1.0/0){|r, (a, b, c)|
[r, V.map{|v|f(v, a, b, c)}.sum].min
}