結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
310icecrystal
|
| 提出日時 | 2023-07-13 04:05:05 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 70 ms / 5,000 ms |
| + 564µs | |
| コード長 | 501 bytes |
| 記録 | |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 96,236 KB |
| 実行使用メモリ | 83,840 KB |
| 最終ジャッジ日時 | 2026-08-27 06:35:11 |
| 合計ジャッジ時間 | 3,505 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
import itertools
patterns_A = list(itertools.permutations(A))
patterns_B = list(itertools.permutations(B))
win_count = 0
for p_A in patterns_A:
for p_B in patterns_B:
win_count_in_this_game = 0
for i in range(N):
win_count_in_this_game += (p_A[i] > p_B[i])
if win_count_in_this_game * 2 > N:
win_count += 1
import math
print(win_count / (math.factorial(N)**2))
310icecrystal