結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2020-03-12 02:02:02 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 5,000 ms |
| コード長 | 381 bytes |
| 記録 | |
| コンパイル時間 | 445 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 60,288 KB |
| 最終ジャッジ日時 | 2026-05-11 08:48:59 |
| 合計ジャッジ時間 | 2,150 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
import itertools
ans = 0
for a in itertools.permutations(A, n):
for b in itertools.permutations(B, n):
w = 0
for i in range(n):
if a[i] > b[i]:
w += 1
if w > n-w:
ans += 1
import math
ans /= math.factorial(n)**2
print(ans)
brthyyjp