結果
問題 |
No.133 カードゲーム
|
ユーザー |
![]() |
提出日時 | 2022-10-17 20:40:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 81,824 KB |
実行使用メモリ | 62,556 KB |
最終ジャッジ日時 | 2024-06-28 10:14:25 |
合計ジャッジ時間 | 2,357 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 3 |
other | AC * 1 WA * 18 |
ソースコード
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(n): 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)