結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:08:09 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 5,000 ms |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 96,112 KB |
| 実行使用メモリ | 83,968 KB |
| 最終ジャッジ日時 | 2026-07-07 12:53:42 |
| 合計ジャッジ時間 | 3,157 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import itertools
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a_perms = list(itertools.permutations(a))
b_perms = list(itertools.permutations(b))
count = 0
total = len(a_perms) * len(b_perms)
for a_p in a_perms:
for b_p in b_perms:
a_win = 0
for i in range(n):
if a_p[i] > b_p[i]:
a_win += 1
if a_win > n // 2:
count += 1
probability = count / total
print("{0:.6f}".format(probability))
lam6er