結果
| 問題 |
No.268 ラッピング(Easy)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-19 11:58:10 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 5,000 ms |
| コード長 | 290 bytes |
| コンパイル時間 | 48 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-10-01 22:38:15 |
| 合計ジャッジ時間 | 2,077 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
Syntax OK
ソースコード
# frozen_string_literal: true
def solve
L.permutation.map(&:wrap_length).min
end
class Array # rubocop:todo Style/Documentation
def wrap_length
2 * combination(2).map(&:sum).zip(C).map { |a, b| a * b }.sum
end
end
L, C = 2.times.map { gets.chomp.split.map(&:to_i) }
puts solve