結果
問題 | No.133 カードゲーム |
ユーザー | wotsushi |
提出日時 | 2017-03-28 08:26:13 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 91 ms / 5,000 ms |
コード長 | 216 bytes |
コンパイル時間 | 53 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-06-25 03:48:49 |
合計ジャッジ時間 | 2,876 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
コンパイルメッセージ
Syntax OK
ソースコード
N = gets.to_i A = gets.split.map(&:to_i) B = gets.split.map(&:to_i) p = (1..N).inject(:*) ans = A.permutation.to_a.product(B.permutation.to_a).count {|a, b| a.zip(b).count {|x, y| x > y} > N / 2}.fdiv(p**2) puts ans