結果
| 問題 | No.1279 Array Battle |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-08 19:03:38 |
| 言語 | Ruby (4.0.6 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 280 ms / 2,000 ms |
| + 545µs | |
| コード長 | 301 bytes |
| 記録 | |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 8,832 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-08-29 19:31:42 |
| 合計ジャッジ時間 | 3,676 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_s.to_i
a = gets.to_s.split.map(&:to_i)
b = gets.to_s.split.map(&:to_i)
m = 0
ans = 0
a.permutation do |a|
s = 0
i = 0
while i < n
if (d = a[i] - b[i]) && d > 0
s += d
end
i += 1
end
if s > m
ans = 1
m = s
elsif s == m
ans += 1
end
end
puts ans