結果

問題 No.133 カードゲーム
ユーザー nohakai3nohakai3
提出日時 2022-10-17 20:44:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 71,696 KB
最終ジャッジ日時 2023-09-10 19:07:54
合計ジャッジ時間 3,052 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,520 KB
testcase_01 AC 71 ms
71,472 KB
testcase_02 AC 69 ms
71,556 KB
testcase_03 AC 70 ms
71,656 KB
testcase_04 AC 71 ms
71,332 KB
testcase_05 AC 71 ms
71,340 KB
testcase_06 AC 70 ms
71,696 KB
testcase_07 AC 71 ms
71,412 KB
testcase_08 AC 72 ms
71,448 KB
testcase_09 AC 71 ms
71,348 KB
testcase_10 AC 71 ms
71,532 KB
testcase_11 AC 71 ms
71,592 KB
testcase_12 AC 71 ms
71,132 KB
testcase_13 AC 70 ms
71,472 KB
testcase_14 AC 71 ms
71,456 KB
testcase_15 AC 71 ms
71,308 KB
testcase_16 AC 70 ms
71,140 KB
testcase_17 AC 70 ms
71,320 KB
testcase_18 AC 70 ms
71,584 KB
testcase_19 AC 71 ms
71,468 KB
testcase_20 AC 70 ms
71,644 KB
testcase_21 AC 71 ms
71,336 KB
testcase_22 AC 71 ms
71,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations


n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
cnt=0
win=0


for i in permutations(A,n):
    cnt+=1
    w=0
    for x,y in zip(i,B):
        if x>y:
            w+=1
        elif y>x:
            w-=1
    if w>0:
        win+=1

print(win/cnt)
0