結果
問題 | No.173 カードゲーム(Medium) |
ユーザー | yaoshimax |
提出日時 | 2015-03-27 00:42:12 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 772 bytes |
コンパイル時間 | 1,460 ms |
コンパイル使用メモリ | 77,048 KB |
実行使用メモリ | 98,924 KB |
最終ジャッジ日時 | 2023-09-11 10:36:46 |
合計ジャッジ時間 | 22,810 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 221 ms
97,388 KB |
testcase_01 | AC | 582 ms
98,312 KB |
testcase_02 | AC | 2,886 ms
98,924 KB |
testcase_03 | AC | 2,909 ms
98,348 KB |
testcase_04 | AC | 2,776 ms
98,584 KB |
testcase_05 | AC | 2,524 ms
98,192 KB |
testcase_06 | AC | 2,230 ms
98,336 KB |
testcase_07 | AC | 1,977 ms
98,376 KB |
testcase_08 | AC | 1,958 ms
98,060 KB |
testcase_09 | TLE | - |
ソースコード
import random N,Pa,Pb=map(float,raw_input().split()) N=int(N) As=map(int,raw_input().split()) Bs=map(int,raw_input().split()) As.sort() Bs.sort() n_win=0 for i in range(1000000): A=[a for a in As] B=[b for b in Bs] Ascore=0 Bscore=0 for j in range(N): a=A[0] b=B[0] if len(A)==1 or random.random()<=Pa: del A[0] else: ai=random.randint(1,len(A)-1) a=A[ai] del A[ai] if len(B)==1 or random.random()<=Pb: del B[0] else: bi=random.randint(1,len(B)-1) b=B[bi] del B[bi] if a>b: Ascore+=a+b else: Bscore+=a+b if Ascore>Bscore: n_win+=1 print n_win*1.0/1000000