結果

問題 No.133 カードゲーム
ユーザー mkawa2mkawa2
提出日時 2019-12-25 16:21:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,247 ms / 5,000 ms
コード長 915 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-04-21 22:03:01
合計ジャッジ時間 40,720 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2,049 ms
11,136 KB
testcase_01 AC 2,010 ms
11,136 KB
testcase_02 AC 2,011 ms
11,136 KB
testcase_03 AC 3,247 ms
11,264 KB
testcase_04 AC 1,602 ms
11,136 KB
testcase_05 AC 1,397 ms
11,136 KB
testcase_06 AC 1,405 ms
11,136 KB
testcase_07 AC 1,407 ms
11,136 KB
testcase_08 AC 1,639 ms
11,264 KB
testcase_09 AC 1,600 ms
11,136 KB
testcase_10 AC 1,407 ms
11,136 KB
testcase_11 AC 1,401 ms
11,264 KB
testcase_12 AC 1,397 ms
11,264 KB
testcase_13 AC 2,030 ms
11,264 KB
testcase_14 AC 1,614 ms
11,136 KB
testcase_15 AC 1,588 ms
11,264 KB
testcase_16 AC 1,395 ms
11,264 KB
testcase_17 AC 1,392 ms
11,136 KB
testcase_18 AC 1,390 ms
11,264 KB
testcase_19 AC 1,391 ms
11,136 KB
testcase_20 AC 1,405 ms
11,136 KB
testcase_21 AC 1,377 ms
11,136 KB
testcase_22 AC 1,398 ms
11,136 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=1000000//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