結果

問題 No.133 カードゲーム
ユーザー ytrjpnytrjpn
提出日時 2021-08-14 00:10:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 60,928 KB
最終ジャッジ日時 2024-10-04 00:56:12
合計ジャッジ時間 2,476 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A+=B
ans=0
a=list(itertools.permutations([i for i in range(N)])) 
b=list(itertools.permutations([i for i in range(N)]))
Z=len(b)
#print(a,b)
ANS=0
for i in range(Z):
    for k in range(Z):
        AT=0
        for j in range(N):
            if A[a[i][j]]>B[b[k][j]]:
                AT+=1
        if 2*AT>N:
            ANS+=1
print(ANS/(Z*Z))
0