結果
問題 | No.133 カードゲーム |
ユーザー | yuruhiya |
提出日時 | 2020-02-02 15:49:33 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 93 ms / 5,000 ms |
コード長 | 258 bytes |
コンパイル時間 | 316 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-09-18 21:08:04 |
合計ジャッジ時間 | 3,152 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i a = gets.split.map &:to_i b = gets.split.map &:to_i x, y = 0, 0 a.permutation do |a_| b.permutation do |b_| cnt = (0...n).to_a.count { |i| a_[i] > b_[i] } x += 1 if cnt > (n - cnt) y += 1 end end puts x / y.to_f