結果

問題 No.133 カードゲーム
ユーザー yayo256yayo256
提出日時 2018-11-21 15:21:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 8,412 KB
最終ジャッジ日時 2023-08-26 02:38:29
合計ジャッジ時間 1,268 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
8,344 KB
testcase_01 AC 15 ms
8,308 KB
testcase_02 AC 14 ms
8,352 KB
testcase_03 AC 13 ms
8,352 KB
testcase_04 AC 13 ms
8,196 KB
testcase_05 AC 14 ms
8,196 KB
testcase_06 AC 13 ms
8,264 KB
testcase_07 AC 14 ms
8,176 KB
testcase_08 AC 13 ms
8,212 KB
testcase_09 AC 13 ms
8,176 KB
testcase_10 AC 14 ms
8,368 KB
testcase_11 AC 13 ms
8,360 KB
testcase_12 AC 15 ms
8,412 KB
testcase_13 AC 13 ms
8,412 KB
testcase_14 AC 13 ms
8,372 KB
testcase_15 AC 12 ms
8,192 KB
testcase_16 AC 14 ms
8,196 KB
testcase_17 AC 16 ms
8,300 KB
testcase_18 AC 13 ms
8,196 KB
testcase_19 AC 14 ms
8,372 KB
testcase_20 AC 14 ms
8,300 KB
testcase_21 AC 14 ms
8,264 KB
testcase_22 AC 13 ms
8,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations as p
from math import factorial as fact

n = int(input())
a, b = [tuple(map(int, input().split(" "))) for _ in range(2)]

count = 0
for a_i in p(a, n):
	for b_i in p(b, n):
		count += (sum(a_j > b_j for a_j, b_j in zip(a_i, b_i)) / n > 0.5)

print(count / fact(n)**2)
0