結果
| 問題 |
No.133 カードゲーム
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2015-10-30 14:00:46 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 699 bytes |
| コンパイル時間 | 103 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 14,208 KB |
| 最終ジャッジ日時 | 2024-06-25 03:40:51 |
| 合計ジャッジ時間 | 3,371 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 19 |
ソースコード
#!/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()
はむ吉🐹