题解:P17151 [ICPC 2017 Xi'an R] God of Gamblers
zhang_kevin · · 题解
先给出结论:父亲胜利的概率
假设父亲下注了
另一方面,如果父亲胜利,则最终手里一共有
又由于每次的期望收益是
于是把
namespace Solution{
int n, m;
inline void Solve(){
while(cin >> n >> m){
double ans = 1.0 * n / (n + m);
cout << fixed << setprecision(5) << ans << '\n';
}
return;
}
}