結果

問題 No.133 カードゲーム
ユーザー RK PythonRK Python
提出日時 2023-02-06 20:17:43
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 299 bytes
コンパイル時間 1,110 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 76,348 KB
最終ジャッジ日時 2023-09-18 06:40:53
合計ジャッジ時間 3,758 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,492 KB
testcase_01 AC 72 ms
71,440 KB
testcase_02 AC 71 ms
71,468 KB
testcase_03 AC 71 ms
71,688 KB
testcase_04 AC 72 ms
71,228 KB
testcase_05 AC 82 ms
76,188 KB
testcase_06 AC 83 ms
76,348 KB
testcase_07 AC 81 ms
76,240 KB
testcase_08 AC 70 ms
71,300 KB
testcase_09 AC 70 ms
71,452 KB
testcase_10 AC 82 ms
76,272 KB
testcase_11 AC 82 ms
76,280 KB
testcase_12 AC 82 ms
76,220 KB
testcase_13 AC 72 ms
71,488 KB
testcase_14 AC 72 ms
71,516 KB
testcase_15 AC 71 ms
71,328 KB
testcase_16 AC 82 ms
76,096 KB
testcase_17 AC 81 ms
76,288 KB
testcase_18 AC 81 ms
76,340 KB
testcase_19 AC 81 ms
76,228 KB
testcase_20 AC 81 ms
76,204 KB
testcase_21 AC 82 ms
76,268 KB
testcase_22 AC 82 ms
76,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
aw = 0
tn = 0
for permA in permutations(A):
    for permB in permutations(B):
        tn += 1
        aw += sum(permA[i]>permB[i] for i in range(N)) > N//2
print(aw / tn)
0