結果

問題 No.133 カードゲーム
ユーザー nohakai3
提出日時 2022-10-17 20:37:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2024-06-28 10:12:19
合計ジャッジ時間 2,560 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations


n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
l1=list(permutations(range(n)))
l2=list(permutations(range(n)))
cnt=0
for x in l1:
    a,b=0,0
    for y in l2:
        for i in range(len(y)):
            if A[x[i]]>B[y[i]]:
                a+=1
            elif A[x[i]]<B[y[i]]:
                b+=1
            print(A[x[i]],B[y[i]])
    if a>b:
        cnt+=1
print(cnt/(n*n))
0