結果

問題 No.133 カードゲーム
ユーザー H3PO4H3PO4
提出日時 2020-05-04 11:56:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 325 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 8,424 KB
最終ジャッジ日時 2023-09-06 06:00:05
合計ジャッジ時間 1,649 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
8,196 KB
testcase_01 AC 14 ms
8,424 KB
testcase_02 AC 14 ms
8,392 KB
testcase_03 AC 14 ms
8,292 KB
testcase_04 AC 14 ms
8,408 KB
testcase_05 AC 15 ms
8,204 KB
testcase_06 AC 15 ms
8,236 KB
testcase_07 AC 15 ms
8,412 KB
testcase_08 AC 14 ms
8,188 KB
testcase_09 AC 15 ms
8,404 KB
testcase_10 AC 15 ms
8,368 KB
testcase_11 AC 14 ms
8,416 KB
testcase_12 AC 15 ms
8,240 KB
testcase_13 AC 13 ms
8,364 KB
testcase_14 AC 17 ms
8,232 KB
testcase_15 AC 14 ms
8,188 KB
testcase_16 AC 14 ms
8,360 KB
testcase_17 AC 14 ms
8,296 KB
testcase_18 AC 14 ms
8,408 KB
testcase_19 AC 15 ms
8,368 KB
testcase_20 AC 15 ms
8,248 KB
testcase_21 AC 14 ms
8,360 KB
testcase_22 AC 14 ms
8,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
from math import factorial

N = int(input())
A = tuple(map(int, input().split()))
B = tuple(map(int, input().split()))

c = 0
for p in itertools.permutations(A):
    for q in itertools.permutations(B):
        if sum(p[i] > q[i] for i in range(N)) > N // 2:
            c += 1
print(c / (factorial(N) ** 2))
0