結果
| 問題 | No.1279 Array Battle |
| コンテスト | |
| ユーザー |
okuramasafumi
|
| 提出日時 | 2020-11-12 15:34:07 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 400 bytes |
| 記録 | |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2026-04-03 10:32:56 |
| 合計ジャッジ時間 | 3,519 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 15 |
コンパイルメッセージ
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.permutation.each do |array|
score = 0
n.times do |i|
diff = array[i] - b[i]
score << diff if diff >= 0
end
if score > current_max_score
count = 1
current_max_score = score
elsif score == current_max_score
count += 1
end
end
puts count
okuramasafumi