結果
問題 | No.133 カードゲーム |
ユーザー |
![]() |
提出日時 | 2025-03-20 21:08:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 46 ms / 5,000 ms |
コード長 | 503 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 82,360 KB |
実行使用メモリ | 61,700 KB |
最終ジャッジ日時 | 2025-03-20 21:08:54 |
合計ジャッジ時間 | 1,882 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
import itertoolsn = 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 = 0total = len(a_perms) * len(b_perms)for a_p in a_perms:for b_p in b_perms:a_win = 0for i in range(n):if a_p[i] > b_p[i]:a_win += 1if a_win > n // 2:count += 1probability = count / totalprint("{0:.6f}".format(probability))