結果
問題 |
No.133 カードゲーム
|
ユーザー |
![]() |
提出日時 | 2018-11-21 15:21:11 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 387 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,008 KB |
最終ジャッジ日時 | 2024-12-24 16:01:44 |
合計ジャッジ時間 | 1,590 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 19 |
ソースコード
from itertools import permutations as p from math import factorial as fact def int_or_float(n): return int(n) if n%1 == 0 else n 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) print(int_or_float(count / fact(n)**2))