結果

問題 No.133 カードゲーム
ユーザー T1610T1610
提出日時 2020-06-30 13:33:32
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 76,736 KB
最終ジャッジ日時 2023-10-01 01:19:41
合計ジャッジ時間 3,718 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,428 KB
testcase_01 AC 72 ms
71,536 KB
testcase_02 AC 71 ms
71,508 KB
testcase_03 AC 73 ms
71,240 KB
testcase_04 AC 74 ms
71,368 KB
testcase_05 AC 79 ms
76,528 KB
testcase_06 AC 83 ms
76,288 KB
testcase_07 AC 81 ms
76,272 KB
testcase_08 AC 71 ms
71,556 KB
testcase_09 AC 71 ms
71,404 KB
testcase_10 AC 78 ms
76,616 KB
testcase_11 AC 77 ms
76,492 KB
testcase_12 AC 78 ms
76,460 KB
testcase_13 AC 72 ms
71,428 KB
testcase_14 AC 74 ms
71,428 KB
testcase_15 AC 72 ms
71,296 KB
testcase_16 AC 81 ms
76,472 KB
testcase_17 AC 80 ms
76,540 KB
testcase_18 AC 82 ms
76,460 KB
testcase_19 AC 79 ms
76,716 KB
testcase_20 AC 77 ms
76,388 KB
testcase_21 AC 79 ms
76,736 KB
testcase_22 AC 79 ms
76,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
n = int(input())
a = map(int, input().split(' '))
b = map(int, input().split(' '))

x = 0
y = 0

A = list(itertools.permutations(a))
B = list(itertools.permutations(b))

for a in A:
    for b in B:
        win = 0
        lose = 0
        for i in range(n):
            if a[i] > b[i]:
                win+=1
            elif a[i] < b[i]:
                lose += 1
        if win > lose:
            x += 1
        y += 1

print(x/y)
0