結果
| 問題 | No.133 カードゲーム | 
| コンテスト | |
| ユーザー |  brthyyjp | 
| 提出日時 | 2020-03-12 02:02:02 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 43 ms / 5,000 ms | 
| コード長 | 381 bytes | 
| コンパイル時間 | 335 ms | 
| コンパイル使用メモリ | 82,420 KB | 
| 実行使用メモリ | 61,696 KB | 
| 最終ジャッジ日時 | 2024-11-16 04:50:17 | 
| 合計ジャッジ時間 | 1,985 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 19 | 
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
import itertools
ans = 0
for a in itertools.permutations(A, n):
    for b in itertools.permutations(B, n):
        w = 0
        for i in range(n):
            if a[i] > b[i]:
                w += 1
        if w > n-w:
            ans += 1
import math
ans /= math.factorial(n)**2
print(ans)
            
            
            
        