結果

問題 No.133 カードゲーム
ユーザー はむ吉🐹はむ吉🐹
提出日時 2015-10-30 14:00:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 699 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 10,508 KB
最終ジャッジ日時 2023-09-07 09:23:06
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
10,172 KB
testcase_01 AC 52 ms
10,508 KB
testcase_02 AC 50 ms
10,268 KB
testcase_03 AC 41 ms
10,376 KB
testcase_04 AC 60 ms
10,472 KB
testcase_05 AC 64 ms
10,224 KB
testcase_06 AC 67 ms
10,292 KB
testcase_07 AC 67 ms
10,448 KB
testcase_08 WA -
testcase_09 AC 57 ms
10,264 KB
testcase_10 AC 64 ms
10,252 KB
testcase_11 AC 62 ms
10,392 KB
testcase_12 AC 63 ms
10,392 KB
testcase_13 WA -
testcase_14 AC 57 ms
10,344 KB
testcase_15 AC 58 ms
10,432 KB
testcase_16 AC 64 ms
10,224 KB
testcase_17 AC 63 ms
10,448 KB
testcase_18 AC 66 ms
10,444 KB
testcase_19 AC 63 ms
10,444 KB
testcase_20 AC 63 ms
10,336 KB
testcase_21 AC 64 ms
10,440 KB
testcase_22 AC 63 ms
10,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import random
import statistics

EXP_TIMES = 10000


def judge(pair):
    if pair[0] > pair[1]:
        return 1
    else:
        return 0


def conduct_experiment(n, acs, bcs):
    random.shuffle(acs)
    random.shuffle(bcs)
    w = sum(map(judge, zip(acs, bcs)))
    if w > n - w:
        return 1.0
    else:
        return 0.0


def main(times=EXP_TIMES):
    n = int(input())
    acs = list(map(int, input().split()))
    bcs = list(map(int, input().split()))
    ans = statistics.mean(conduct_experiment(n, acs, bcs)
                          for x in range(times))
    print("{ans:.5f}".format(ans=ans))

if __name__ == "__main__":
    main()
0