結果
| 問題 |
No.90 品物の並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-23 08:01:34 |
| 言語 | Ruby (3.4.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 270 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 30,756 KB |
| 最終ジャッジ日時 | 2024-06-23 15:41:57 |
| 合計ジャッジ時間 | 9,332 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 TLE * 1 |
コンパイルメッセージ
Syntax OK
ソースコード
# frozen_string_literal: true
class Array
def score
I.map { |l, r, s| index(l) < index(r) ? s : 0 }.sum
end
end
def solve
(0..(N - 1)).to_a.permutation.map(&:score).max
end
N, M = gets.split.map(&:to_i)
I = M.times.map { gets.split.map(&:to_i) }
puts solve