結果

問題 No.133 カードゲーム
ユーザー Akiyoshi OhtaniAkiyoshi Ohtani
提出日時 2020-08-05 20:45:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 536 bytes
コンパイル時間 1,690 ms
コンパイル使用メモリ 81,584 KB
実行使用メモリ 61,560 KB
最終ジャッジ日時 2023-10-17 13:15:29
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,436 KB
testcase_01 AC 37 ms
53,436 KB
testcase_02 AC 37 ms
53,432 KB
testcase_03 AC 35 ms
53,432 KB
testcase_04 AC 36 ms
53,436 KB
testcase_05 AC 46 ms
61,556 KB
testcase_06 AC 46 ms
61,560 KB
testcase_07 AC 47 ms
61,560 KB
testcase_08 AC 36 ms
53,436 KB
testcase_09 AC 36 ms
53,436 KB
testcase_10 AC 46 ms
61,556 KB
testcase_11 AC 47 ms
61,560 KB
testcase_12 AC 46 ms
61,560 KB
testcase_13 AC 36 ms
53,436 KB
testcase_14 AC 36 ms
53,436 KB
testcase_15 AC 36 ms
53,436 KB
testcase_16 AC 47 ms
61,556 KB
testcase_17 AC 46 ms
61,552 KB
testcase_18 AC 46 ms
61,556 KB
testcase_19 AC 47 ms
61,556 KB
testcase_20 AC 47 ms
61,556 KB
testcase_21 AC 47 ms
61,552 KB
testcase_22 AC 48 ms
61,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def backtrack(res, path):
    if len(path) == N:
        res.append(path)
        return
    for i in range(N):
        if i in path:
            continue
        backtrack(res, path + [i])

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

resA = []
visited = set()
backtrack(resA, [])
resB = []
visited = set()
backtrack(resB, [])

res = 0

for aL in resA:
    for bL in resB:
        res += N // 2 < sum(map(lambda pair: A[pair[0]] > B[pair[1]], zip(aL, bL)))

print(res/(len(resA)*len(resB)))
0