結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2020-11-19 16:21:27 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 94 ms / 5,000 ms |
コード長 | 353 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,672 KB |
最終ジャッジ日時 | 2024-07-23 10:05:13 |
合計ジャッジ時間 | 3,026 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_iA = gets.split.map(&:to_i)B = gets.split.map(&:to_i)total = 0win = 0[*0...N].permutation(N) do |listA|[*0...N].permutation(N) do |listB|total += 1win_cnt = 0listA.zip(listB) do |ia, ib|win_cnt += 1 if A[ia] > B[ib]endwin += 1 if win_cnt > N / 2endendputs Rational(win, total).to_f.round(12)