結果

問題 No.133 カードゲーム
ユーザー ayaoniayaoni
提出日時 2020-10-07 20:14:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 1,681 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 71,764 KB
最終ジャッジ日時 2023-09-27 09:46:10
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,336 KB
testcase_01 AC 64 ms
71,252 KB
testcase_02 AC 65 ms
71,372 KB
testcase_03 AC 64 ms
71,616 KB
testcase_04 AC 62 ms
71,444 KB
testcase_05 AC 68 ms
71,436 KB
testcase_06 AC 61 ms
71,236 KB
testcase_07 AC 64 ms
71,520 KB
testcase_08 AC 66 ms
71,524 KB
testcase_09 AC 71 ms
71,764 KB
testcase_10 AC 68 ms
71,748 KB
testcase_11 AC 65 ms
71,492 KB
testcase_12 AC 61 ms
71,444 KB
testcase_13 AC 64 ms
71,252 KB
testcase_14 AC 65 ms
71,444 KB
testcase_15 AC 63 ms
71,436 KB
testcase_16 AC 62 ms
71,192 KB
testcase_17 AC 75 ms
71,212 KB
testcase_18 AC 63 ms
71,340 KB
testcase_19 AC 64 ms
71,596 KB
testcase_20 AC 65 ms
71,528 KB
testcase_21 AC 64 ms
71,600 KB
testcase_22 AC 64 ms
71,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from itertools import permutations
from math import factorial
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N = I()
A,B = LI(),LI()

A_win = 0
for X in permutations(B,N):
    count = 0
    for i in range(N):
        if A[i] > X[i]:
            count += 1
    if count > N//2:
        A_win += 1

print(A_win/factorial(N))
0