結果

問題 No.133 カードゲーム
ユーザー mkawa2mkawa2
提出日時 2019-12-25 16:23:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 369 ms / 5,000 ms
コード長 914 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 12,104 KB
実行使用メモリ 10,424 KB
最終ジャッジ日時 2023-10-25 08:58:24
合計ジャッジ時間 6,246 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 249 ms
10,424 KB
testcase_01 AC 244 ms
10,424 KB
testcase_02 AC 244 ms
10,424 KB
testcase_03 AC 369 ms
10,424 KB
testcase_04 AC 200 ms
10,424 KB
testcase_05 AC 180 ms
10,424 KB
testcase_06 AC 177 ms
10,424 KB
testcase_07 AC 179 ms
10,424 KB
testcase_08 AC 202 ms
10,424 KB
testcase_09 AC 200 ms
10,424 KB
testcase_10 AC 179 ms
10,424 KB
testcase_11 AC 179 ms
10,424 KB
testcase_12 AC 178 ms
10,424 KB
testcase_13 AC 246 ms
10,424 KB
testcase_14 AC 200 ms
10,424 KB
testcase_15 AC 202 ms
10,424 KB
testcase_16 AC 178 ms
10,424 KB
testcase_17 AC 175 ms
10,424 KB
testcase_18 AC 178 ms
10,424 KB
testcase_19 AC 179 ms
10,424 KB
testcase_20 AC 181 ms
10,424 KB
testcase_21 AC 178 ms
10,424 KB
testcase_22 AC 179 ms
10,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import *
from math import *
from collections import *
from heapq import *
from random import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=II()
    aa=LI()
    bb=LI()
    game_win=0
    sample_number=100000//n
    for _ in range(sample_number):
        turn_win=0
        rand_aa=sample(aa,n)
        rand_bb=sample(bb,n)
        for a,b in zip(rand_aa,rand_bb):
            if a>b:turn_win+=1
        if turn_win*2>n:game_win+=1
    print(game_win/sample_number)

main()
0