結果

問題 No.425 ジャンケンの必勝法
ユーザー convexineqconvexineq
提出日時 2021-02-23 06:32:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 273 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 81,744 KB
実行使用メモリ 64,324 KB
最終ジャッジ日時 2023-10-22 01:53:35
合計ジャッジ時間 2,531 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,496 KB
testcase_01 AC 38 ms
53,496 KB
testcase_02 AC 38 ms
53,496 KB
testcase_03 AC 44 ms
60,032 KB
testcase_04 AC 49 ms
62,164 KB
testcase_05 AC 47 ms
62,232 KB
testcase_06 WA -
testcase_07 AC 45 ms
60,108 KB
testcase_08 AC 46 ms
59,652 KB
testcase_09 AC 40 ms
53,496 KB
testcase_10 AC 39 ms
53,496 KB
testcase_11 AC 40 ms
53,496 KB
testcase_12 AC 45 ms
60,108 KB
testcase_13 WA -
testcase_14 AC 45 ms
60,108 KB
testcase_15 AC 38 ms
53,496 KB
testcase_16 AC 43 ms
59,968 KB
testcase_17 AC 39 ms
53,496 KB
testcase_18 AC 38 ms
53,496 KB
testcase_19 AC 38 ms
53,496 KB
testcase_20 AC 43 ms
60,096 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

p,q = map(lambda x: int(x)/100,input().split())
ans = 1/3
st = [(1/3,p)] #prob, p, used?
while st:
    prob, p = st.pop()
    if prob < 1e-9: continue
    ans += prob*((1-p)/3 + p/2)
    st.append((prob*((1-p)/3),min(1,p+q)))
    st.append((prob*p/2,max(0,p-q)))
print(ans)
0