結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
makotokyoto
|
| 提出日時 | 2020-07-13 04:06:51 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 5,000 ms |
| コード長 | 528 bytes |
| 記録 | |
| コンパイル時間 | 668 ms |
| コンパイル使用メモリ | 20,572 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-06 23:55:35 |
| 合計ジャッジ時間 | 3,803 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
from itertools import permutations
import math
N=int(input()) #1<=N<=4
A=list(map(int,input().split())) #1から2*Nまでのカードが存在する
B=list(map(int,input().split()))
a=permutations(A,N)
b=permutations(B,N)
n=math.factorial(N)
ans=0
for x in permutations(A) :
for y in permutations(B) :
win,lose=0,0
for k in range(N) :
if x[k]>y[k] :
win+=1
else :
lose+=1
if win>lose :
ans+=1
print(ans/n**2)
makotokyoto