7 条题解

  • 2
    @ 2024-3-14 13:47:13
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	double j,q,k=0,a,b,c=0;
    	cin>>j>>q;
    	b=j;
    		for(int l=1;l<=q+1;l++)
    	{
    		j/=2;
    		c=2*j;
    	}
    
    	for(int i=1;i<=q;i++)
    	{
    		k+=b+b/2;
    		b/=2;
    	}
    	cout<<fixed<<setprecision(6)<<k-c;
    	return 0;
    }
    

    信息

    ID
    57
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    175
    已通过
    59
    上传者