結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2021-03-11 14:20:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 438 bytes |
コンパイル時間 | 230 ms |
コンパイル使用メモリ | 82,236 KB |
実行使用メモリ | 71,040 KB |
最終ジャッジ日時 | 2024-10-13 02:47:21 |
合計ジャッジ時間 | 2,219 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 19 |
ソースコード
import math import itertools N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) A=list(itertools.permutations(A)) B=list(itertools.permutations(B)) t=math.factorial(N) ans=0 for i in range(t): for j in range(t): a=A[i];b=B[j] tmp=0 for k in range(N): if a[k]>b[k]: tmp+=1 if tmp>N//2: ans+=1 print(a,b,tmp) print(ans/(t**2))