結果

問題 No.133 カードゲーム
ユーザー brthyyjpbrthyyjp
提出日時 2020-03-12 02:02:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 61,432 KB
最終ジャッジ日時 2024-04-27 22:14:33
合計ジャッジ時間 1,623 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
52,268 KB
testcase_01 AC 31 ms
52,152 KB
testcase_02 AC 33 ms
52,196 KB
testcase_03 AC 33 ms
52,788 KB
testcase_04 AC 35 ms
52,276 KB
testcase_05 AC 36 ms
59,328 KB
testcase_06 AC 38 ms
60,240 KB
testcase_07 AC 37 ms
60,476 KB
testcase_08 AC 31 ms
52,820 KB
testcase_09 AC 30 ms
52,820 KB
testcase_10 AC 36 ms
59,800 KB
testcase_11 AC 36 ms
61,148 KB
testcase_12 AC 37 ms
61,432 KB
testcase_13 AC 32 ms
53,616 KB
testcase_14 AC 32 ms
53,388 KB
testcase_15 AC 31 ms
53,364 KB
testcase_16 AC 39 ms
61,324 KB
testcase_17 AC 37 ms
59,072 KB
testcase_18 AC 40 ms
61,308 KB
testcase_19 AC 37 ms
60,208 KB
testcase_20 AC 35 ms
60,804 KB
testcase_21 AC 38 ms
60,056 KB
testcase_22 AC 37 ms
60,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

import itertools
ans = 0
for a in itertools.permutations(A, n):
    for b in itertools.permutations(B, n):
        w = 0
        for i in range(n):
            if a[i] > b[i]:
                w += 1
        if w > n-w:
            ans += 1
import math
ans /= math.factorial(n)**2
print(ans)
0