正题
题目大意
开始暴击率为xxx,每次失败后都会增加xxx,成功后重置,然后求攻击1010610^{10^6}10106次后的暴击次数除以1010610^{10^6}10106
解题思路
定义ansansans为期望攻击多少次后暴击,然后答案为1ans\frac{1}{ans}ans1。然后ansansans可以枚举多少次暴击计算即可。
codecodecode
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
double x,ans;
int main()
{
// freopen("lol.in","r",stdin);
// freopen("lol.out","w",stdout);scanf("%lf",&x);double q=1,i;for(i=1;i<=100/x;i++){ans=ans+i*i*x*q*0.01;q*=(100-i*x)*0.01;}ans+=i*q; printf("%.10lf",1.0/ans);
}