結果

問題 No.133 カードゲーム
ユーザー mlihua09mlihua09
提出日時 2020-08-28 00:56:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 64,128 KB
最終ジャッジ日時 2024-04-26 10:25:24
合計ジャッジ時間 2,035 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
51,840 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 38 ms
51,968 KB
testcase_03 AC 38 ms
52,352 KB
testcase_04 AC 39 ms
52,608 KB
testcase_05 AC 57 ms
63,744 KB
testcase_06 AC 57 ms
63,488 KB
testcase_07 AC 56 ms
64,000 KB
testcase_08 AC 39 ms
52,352 KB
testcase_09 AC 38 ms
52,096 KB
testcase_10 AC 61 ms
63,488 KB
testcase_11 AC 56 ms
63,488 KB
testcase_12 AC 56 ms
62,976 KB
testcase_13 AC 38 ms
52,736 KB
testcase_14 AC 38 ms
52,224 KB
testcase_15 AC 39 ms
52,352 KB
testcase_16 AC 58 ms
63,488 KB
testcase_17 AC 54 ms
62,592 KB
testcase_18 AC 58 ms
63,232 KB
testcase_19 AC 58 ms
64,128 KB
testcase_20 AC 59 ms
63,616 KB
testcase_21 AC 58 ms
63,872 KB
testcase_22 AC 56 ms
63,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


N = int(input())

from itertools import permutations

A = list(map(int, input().split()))

B = list(map(int, input().split()))

W = 0

S = 0

for i in permutations(range(N), r=N):
    
    for j in permutations(range(N), r=N):
        
        if sum([1 if A[i[k]] > B[j[k]] else 0 for k in range(N)]) > sum([1 if A[i[k]] < B[j[k]] else 0 for k in range(N)]):
            
            W += 1
            
        S += 1
        
        
print(W / S)
0