結果

問題 No.133 カードゲーム
ユーザー rlangevinrlangevin
提出日時 2023-01-08 20:30:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 373 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 76,660 KB
最終ジャッジ日時 2023-08-22 05:35:35
合計ジャッジ時間 3,262 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,472 KB
testcase_01 AC 67 ms
71,420 KB
testcase_02 AC 66 ms
71,412 KB
testcase_03 AC 72 ms
71,364 KB
testcase_04 AC 73 ms
71,512 KB
testcase_05 AC 72 ms
76,332 KB
testcase_06 AC 74 ms
76,392 KB
testcase_07 AC 72 ms
76,364 KB
testcase_08 AC 67 ms
71,420 KB
testcase_09 AC 69 ms
71,476 KB
testcase_10 AC 75 ms
76,400 KB
testcase_11 AC 76 ms
76,160 KB
testcase_12 AC 77 ms
76,480 KB
testcase_13 AC 71 ms
71,352 KB
testcase_14 AC 73 ms
71,428 KB
testcase_15 AC 76 ms
71,556 KB
testcase_16 AC 79 ms
76,396 KB
testcase_17 AC 75 ms
76,312 KB
testcase_18 AC 78 ms
76,356 KB
testcase_19 AC 76 ms
76,644 KB
testcase_20 AC 75 ms
76,324 KB
testcase_21 AC 78 ms
76,660 KB
testcase_22 AC 77 ms
76,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for a in permutations(A):
    for b in permutations(B):
        cnt = 0
        for i in range(N):
            if a[i] > b[i]:
                cnt += 1
        if cnt * 2 > N:
            ans += 1

for i in range(1, N + 1):
    ans /= i * i
print(ans)
0