結果
| 問題 |
No.133 カードゲーム
|
| コンテスト | |
| ユーザー |
valusun
|
| 提出日時 | 2020-11-03 15:59:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 5,000 ms |
| コード長 | 432 bytes |
| コンパイル時間 | 117 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-07-22 08:52:41 |
| 合計ジャッジ時間 | 1,738 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
from itertools import permutations
from math import factorial
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
total = factorial(N)**2
win = 0
for Pattern_A in permutations(A):
for Pattern_B in permutations(B):
win_cnt = 0
for a,b in zip(Pattern_A, Pattern_B):
if a>b:
win_cnt += 1
if win_cnt > N//2:
win+=1
print(win/total)
valusun