結果

問題 No.133 カードゲーム
ユーザー daku9640daku9640
提出日時 2017-02-22 15:59:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 10,672 KB
実行使用メモリ 8,208 KB
最終ジャッジ日時 2023-09-07 09:30:59
合計ジャッジ時間 1,529 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,100 KB
testcase_01 AC 17 ms
8,080 KB
testcase_02 AC 16 ms
8,152 KB
testcase_03 AC 16 ms
8,128 KB
testcase_04 AC 16 ms
8,124 KB
testcase_05 AC 16 ms
7,988 KB
testcase_06 AC 16 ms
8,128 KB
testcase_07 AC 16 ms
8,072 KB
testcase_08 AC 16 ms
8,068 KB
testcase_09 AC 16 ms
8,176 KB
testcase_10 AC 16 ms
8,056 KB
testcase_11 AC 16 ms
7,988 KB
testcase_12 AC 16 ms
8,120 KB
testcase_13 AC 16 ms
8,200 KB
testcase_14 AC 16 ms
8,124 KB
testcase_15 AC 16 ms
8,208 KB
testcase_16 AC 16 ms
8,128 KB
testcase_17 AC 16 ms
8,028 KB
testcase_18 AC 16 ms
8,192 KB
testcase_19 AC 16 ms
8,132 KB
testcase_20 AC 17 ms
8,032 KB
testcase_21 AC 16 ms
8,024 KB
testcase_22 AC 16 ms
8,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import permutations

n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

cnt = win = 0

for i in permutations(a, n):
    cnt += 1
    w = 0
    for x, y in zip(i, b):
        if x > y: w += 1
        elif x < y: w -= 1
    if w > 0: win += 1

print(win / cnt)
0