結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2020-02-09 05:51:44 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 115 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-01 05:44:01 |
合計ジャッジ時間 | 1,643 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
from itertools import permutationsfrom math import factorialn = int(input())a = list(map(int, input().split()))b = list(map(int, input().split()))win = 0for A in permutations(a):for B in permutations(b):cnt = 0for i in range(n):if A[i] > B[i]:cnt += 1if cnt > n//2:win += 1print(win/factorial(n)/factorial(n))