結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2016-09-16 17:49:39 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 94 ms / 5,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 73 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-06-25 03:44:06 |
合計ジャッジ時間 | 2,879 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i a = gets.split.map(&:to_i) b = gets.split.map(&:to_i) win = 0 game = 0 a.permutation(n) do |i| b.permutation(n) do |j| t_win = 0 t_lose = 0 0.upto(n - 1) do |x| i[x] > j[x] ? t_win += 1 : t_lose += 1 end win += 1 if t_win > t_lose game += 1 end end p win.to_f / game