結果

問題 No.133 カードゲーム
ユーザー roarisroaris
提出日時 2019-12-09 01:33:23
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 71,532 KB
最終ジャッジ日時 2023-08-31 01:17:00
合計ジャッジ時間 3,513 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,288 KB
testcase_01 AC 71 ms
71,192 KB
testcase_02 AC 69 ms
71,376 KB
testcase_03 AC 68 ms
71,420 KB
testcase_04 AC 69 ms
71,416 KB
testcase_05 AC 70 ms
71,352 KB
testcase_06 AC 71 ms
71,444 KB
testcase_07 AC 70 ms
71,312 KB
testcase_08 AC 71 ms
70,964 KB
testcase_09 AC 70 ms
70,980 KB
testcase_10 AC 70 ms
71,528 KB
testcase_11 AC 71 ms
71,532 KB
testcase_12 AC 72 ms
71,196 KB
testcase_13 AC 72 ms
71,524 KB
testcase_14 AC 71 ms
71,532 KB
testcase_15 AC 71 ms
71,236 KB
testcase_16 AC 71 ms
71,188 KB
testcase_17 AC 69 ms
71,020 KB
testcase_18 AC 70 ms
71,416 KB
testcase_19 AC 70 ms
71,200 KB
testcase_20 AC 70 ms
71,324 KB
testcase_21 AC 71 ms
70,968 KB
testcase_22 AC 70 ms
70,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
s = 0

for p in permutations(A):
    win, lose = 0, 0
    
    for i in range(N):
        if p[i]>B[i]:
            win += 1
        else:
            lose += 1
    
    if win>lose:
        ans += 1

    s += 1
    
print("{:.10f}".format(ans/s))
0