結果
| 問題 | No.133 カードゲーム | 
| コンテスト | |
| ユーザー |  nohakai3 | 
| 提出日時 | 2022-10-17 20:44:09 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 39 ms / 5,000 ms | 
| コード長 | 314 bytes | 
| コンパイル時間 | 179 ms | 
| コンパイル使用メモリ | 82,100 KB | 
| 実行使用メモリ | 53,764 KB | 
| 最終ジャッジ日時 | 2024-06-28 10:16:35 | 
| 合計ジャッジ時間 | 1,897 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 19 | 
ソースコード
from itertools import permutations
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
cnt=0
win=0
for i in permutations(A,n):
    cnt+=1
    w=0
    for x,y in zip(i,B):
        if x>y:
            w+=1
        elif y>x:
            w-=1
    if w>0:
        win+=1
print(win/cnt)
            
            
            
        