結果
| 問題 |
No.133 カードゲーム
|
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2018-03-25 18:47:37 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 281 ms / 5,000 ms |
| コード長 | 699 bytes |
| コンパイル時間 | 87 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 14,208 KB |
| 最終ジャッジ日時 | 2024-06-25 06:07:42 |
| 合計ジャッジ時間 | 6,982 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import random
import statistics
EXP_TIMES = 50000
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()
はむ吉🐹