結果

問題 No.133 カードゲーム
ユーザー Sho Okuhara
提出日時 2020-05-27 22:24:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 5,000 ms
コード長 365 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-13 03:50:14
合計ジャッジ時間 1,471 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
As = list(permutations(A, n))
Bs = list(permutations(B, n))

vic = 0
thr = n//2

for a in As:
    for b in Bs:
        tmp = len([i for i, j in zip(a, b) if i > j])
        if tmp > thr:
            vic += 1

print(vic / (len(As)*len(Bs)))
0