結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,344 KB
testcase_01 AC 15 ms
8,204 KB
testcase_02 AC 16 ms
8,292 KB
testcase_03 AC 15 ms
8,224 KB
testcase_04 AC 14 ms
8,344 KB
testcase_05 AC 15 ms
8,376 KB
testcase_06 AC 14 ms
8,368 KB
testcase_07 AC 14 ms
8,256 KB
testcase_08 AC 13 ms
8,396 KB
testcase_09 AC 14 ms
8,392 KB
testcase_10 AC 15 ms
8,388 KB
testcase_11 AC 15 ms
8,440 KB
testcase_12 AC 14 ms
8,316 KB
testcase_13 AC 13 ms
8,220 KB
testcase_14 AC 14 ms
8,260 KB
testcase_15 AC 13 ms
8,344 KB
testcase_16 AC 14 ms
8,376 KB
testcase_17 AC 14 ms
8,260 KB
testcase_18 AC 14 ms
8,380 KB
testcase_19 AC 15 ms
8,288 KB
testcase_20 AC 15 ms
8,260 KB
testcase_21 AC 13 ms
8,308 KB
testcase_22 AC 14 ms
8,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations, product
from math import factorial

def int_or_float(n):
	return int(n) if n%1 == 0 else n

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

print(int_or_float(sum(sum(a_i>b_i for a_i, b_i in zip(*x)) > n/2 for x in list(product(permutations(a, n), permutations(b, n)))) / factorial(n)**2))
0