結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2015-10-30 14:00:46 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 699 bytes |
| 記録 | |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 21,408 KB |
| 実行使用メモリ | 16,552 KB |
| 最終ジャッジ日時 | 2026-07-29 14:50:04 |
| 合計ジャッジ時間 | 5,239 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 18 WA * 1 |
ソースコード
#!/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()
はむ吉🐹