結果

問題 No.133 カードゲーム
ユーザー mitsu-suzuki
提出日時 2020-05-19 22:51:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 544 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,460 KB
最終ジャッジ日時 2024-10-01 23:11:54
合計ジャッジ時間 15,349 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

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