結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2021-07-22 23:43:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 565 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-17 21:02:22 |
合計ジャッジ時間 | 2,183 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertoolsimport mathn = int(input())A = list(map(int, input().split()))B = list(map(int, input().split()))win_A = 0for order_A in itertools.permutations(A):for order_B in itertools.permutations(B):point_A = 0point_B = 0for i in range(n):if order_A[i] > order_B[i]:point_A += 1else:point_B += 1if point_A > point_B:win_A += 1num_mathces = math.factorial(n) ** 2print(win_A / num_mathces)