結果

問題 No.133 カードゲーム
ユーザー RK Python
提出日時 2023-02-06 20:17:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 81,896 KB
実行使用メモリ 61,440 KB
最終ジャッジ日時 2024-07-04 22:51:04
合計ジャッジ時間 2,123 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
aw = 0
tn = 0
for permA in permutations(A):
    for permB in permutations(B):
        tn += 1
        aw += sum(permA[i]>permB[i] for i in range(N)) > N//2
print(aw / tn)
0