結果

問題 No.133 カードゲーム
ユーザー mitsu-suzukimitsu-suzuki
提出日時 2020-05-19 22:51:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 510 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 44,588 KB
最終ジャッジ日時 2024-04-09 22:37:49
合計ジャッジ時間 13,226 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 473 ms
44,580 KB
testcase_01 AC 474 ms
44,072 KB
testcase_02 AC 465 ms
44,456 KB
testcase_03 AC 468 ms
44,068 KB
testcase_04 AC 464 ms
44,196 KB
testcase_05 AC 510 ms
44,324 KB
testcase_06 AC 475 ms
44,204 KB
testcase_07 AC 478 ms
44,196 KB
testcase_08 AC 473 ms
44,448 KB
testcase_09 AC 466 ms
44,324 KB
testcase_10 AC 479 ms
44,588 KB
testcase_11 AC 478 ms
44,324 KB
testcase_12 AC 485 ms
44,332 KB
testcase_13 AC 465 ms
44,444 KB
testcase_14 AC 468 ms
44,068 KB
testcase_15 AC 481 ms
43,944 KB
testcase_16 AC 484 ms
44,200 KB
testcase_17 AC 489 ms
44,068 KB
testcase_18 AC 485 ms
44,200 KB
testcase_19 AC 485 ms
44,448 KB
testcase_20 AC 476 ms
44,576 KB
testcase_21 AC 475 ms
44,068 KB
testcase_22 AC 493 ms
44,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import itertools
import numpy as np

input = sys.stdin.readline


def S():
    return input().rstrip()


def I():
    return int(input())


def MI():
    return map(int, input().split())


n = I()
ac = list(MI())
bc = list(MI())

ans = 0
count = 0
for a in itertools.permutations(ac):
    for b in itertools.permutations(bc):
        count += 1
        result = np.array(a) - np.array(b)
        win = np.sum(result > 0)
        lose = np.sum(result < 0)
        if win > lose:
            ans += 1

print(ans / count)
0