結果
| 問題 |
No.1279 Array Battle
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-06 21:25:47 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 926 ms / 2,000 ms |
| コード長 | 249 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,544 KB |
| 最終ジャッジ日時 | 2024-07-22 12:05:20 |
| 合計ジャッジ時間 | 6,841 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - n Syntax OK
ソースコード
def lscan; gets.split.map(&:to_i); end
n = gets.to_i
aa = lscan
bb = lscan
best = -1
c = 0
aa.permutation do |ap|
w = ap.zip(bb).map{|a,b| [a-b, 0].max }.reduce(:+)
if best < w
best = w
c = 1
elsif best == w
c += 1
end
end
p c