結果

問題 No.133 カードゲーム
ユーザー ytrjpnytrjpn
提出日時 2021-08-14 00:10:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 82,400 KB
実行使用メモリ 62,872 KB
最終ジャッジ日時 2024-04-14 21:31:58
合計ジャッジ時間 2,293 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,536 KB
testcase_01 AC 37 ms
52,856 KB
testcase_02 AC 37 ms
52,268 KB
testcase_03 AC 36 ms
53,340 KB
testcase_04 AC 38 ms
52,192 KB
testcase_05 AC 43 ms
60,276 KB
testcase_06 AC 44 ms
61,160 KB
testcase_07 AC 44 ms
60,920 KB
testcase_08 AC 37 ms
52,944 KB
testcase_09 AC 38 ms
52,880 KB
testcase_10 AC 45 ms
60,052 KB
testcase_11 AC 43 ms
61,044 KB
testcase_12 AC 44 ms
62,216 KB
testcase_13 AC 37 ms
52,440 KB
testcase_14 AC 37 ms
52,456 KB
testcase_15 AC 37 ms
52,380 KB
testcase_16 AC 45 ms
61,192 KB
testcase_17 AC 42 ms
60,428 KB
testcase_18 AC 45 ms
62,872 KB
testcase_19 AC 43 ms
60,664 KB
testcase_20 AC 43 ms
61,288 KB
testcase_21 AC 44 ms
62,136 KB
testcase_22 AC 45 ms
62,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A+=B
ans=0
a=list(itertools.permutations([i for i in range(N)])) 
b=list(itertools.permutations([i for i in range(N)]))
Z=len(b)
#print(a,b)
ANS=0
for i in range(Z):
    for k in range(Z):
        AT=0
        for j in range(N):
            if A[a[i][j]]>B[b[k][j]]:
                AT+=1
        if 2*AT>N:
            ANS+=1
print(ANS/(Z*Z))
0