結果
| 問題 |
No.133 カードゲーム
|
| ユーザー |
nohakai3
|
| 提出日時 | 2022-10-17 20:38:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 426 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 60,928 KB |
| 最終ジャッジ日時 | 2024-06-28 10:12:51 |
| 合計ジャッジ時間 | 2,043 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 6 WA * 13 |
ソースコード
from itertools import permutations
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
l1=list(permutations(range(n)))
l2=list(permutations(range(n)))
cnt=0
for x in l1:
a,b=0,0
for y in l2:
for i in range(len(y)):
if A[x[i]]>B[y[i]]:
a+=1
elif A[x[i]]<B[y[i]]:
b+=1
if a>b:
cnt+=1
print(cnt/(n*n))
nohakai3