結果
問題 | No.133 カードゲーム |
ユーザー | yayo256 |
提出日時 | 2018-11-15 10:42:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 358 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-24 13:52:54 |
合計ジャッジ時間 | 1,460 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
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))