結果

問題 No.133 カードゲーム
ユーザー yukuyonyukuyon
提出日時 2020-07-19 20:01:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 76,496 KB
最終ジャッジ日時 2023-08-22 12:30:45
合計ジャッジ時間 3,377 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,624 KB
testcase_01 AC 76 ms
71,448 KB
testcase_02 AC 75 ms
71,400 KB
testcase_03 AC 73 ms
71,152 KB
testcase_04 AC 74 ms
71,532 KB
testcase_05 AC 80 ms
76,496 KB
testcase_06 AC 80 ms
76,352 KB
testcase_07 AC 78 ms
76,376 KB
testcase_08 AC 71 ms
71,548 KB
testcase_09 AC 73 ms
71,584 KB
testcase_10 AC 80 ms
76,392 KB
testcase_11 AC 82 ms
76,380 KB
testcase_12 AC 79 ms
76,208 KB
testcase_13 AC 74 ms
71,296 KB
testcase_14 AC 72 ms
71,496 KB
testcase_15 AC 74 ms
71,592 KB
testcase_16 AC 80 ms
76,348 KB
testcase_17 AC 78 ms
76,460 KB
testcase_18 AC 82 ms
76,448 KB
testcase_19 AC 81 ms
76,260 KB
testcase_20 AC 81 ms
76,160 KB
testcase_21 AC 82 ms
76,164 KB
testcase_22 AC 80 ms
76,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
n=int(input())
g=0
w=0
a=list(map(int,input().split()))
b=list(map(int,input().split()))
for j in permutations(a):
    for k in permutations(b):
        g+=1
        aa=0
        bb=0
        for i in range(n):
            if j[i]>k[i]:
                aa+=1
            else:
                bb+=1
        if aa>bb:
            w+=1
print(w/g)
                
0