結果
| 問題 | No.1279 Array Battle |
| コンテスト | |
| ユーザー |
okuramasafumi
|
| 提出日時 | 2020-11-13 09:52:12 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 1,209 ms / 2,000 ms |
| コード長 | 403 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 7,680 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2024-07-22 19:52:29 |
| 合計ジャッジ時間 | 8,692 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
Syntax OK
ソースコード
n, a, b = 3.times.map { gets }
n = n.to_i
a = a.split(' ').map(&:to_i)
b = b.split(' ').map(&:to_i)
count = 0
current_max_score = 0
a.sort.permutation.each do |array|
score = n.times.map do |i|
diff = array[i] - b[i]
diff >= 0 ? diff : 0
end.sum
if score > current_max_score
count = 1
current_max_score = score
elsif score == current_max_score
count += 1
end
end
puts count
okuramasafumi