結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-01 01:31:57 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 28 ms / 5,000 ms |
| + 266µs | |
| コード長 | 358 bytes |
| 記録 | |
| コンパイル時間 | 258 ms |
| コンパイル使用メモリ | 81,416 KB |
| 実行使用メモリ | 63,952 KB |
| 最終ジャッジ日時 | 2026-09-26 16:58:30 |
| 合計ジャッジ時間 | 3,181 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import itertools as it
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for pa in it.permutations(a, n):
for pb in it.permutations(b, n):
cnt = 0
for i in range(n):
if pa[i] > pb[i]:
cnt += 1
if cnt > n // 2:
ans += 1
ans /= (math.factorial(n) ** 2)
print(ans)