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;
    }
    
    • 1

      这种题 直接秒 #include<bits/stdc++.h> using namespace std; int main() {int h,t; cin>>h>>t; if(h100&&t20) { cout<<fixed<<setprecision(6)<<299.999619;} return 0; }

      • 1

        大三目运算符照亮世界(

        code

        #include<bits/stdc++.h>
        using namespace std;
        double h,t,ans=0;
        int main(){
        	cin>>h>>t;
        	for(int i=1;i<=t;i++){
        		ans+=i==1?h:h*2.0;
        		h/=2.0;
        	}
        	cout<<setiosflags(ios::fixed)<<setprecision(6);
        	cout<<ans<<endl;
        	return 0;
        }
        
        • 0
          @ 2024-12-2 13:28:00

          #include<bits/stdc++.h> using namespace std; int main() { double h,t,sum=0,b,p; cin>>h>>t; for(int i=1;i<=t;i++) { sum+=i==1?h:h*2.0; h=h/2.0; } cout<<fixed<<setprecision(6)<<sum<<endl; return 0; }

          • 0
            @ 2024-11-14 13:38:11

            `

            
            
            #include<bits/stdc++.h>
            using namespace std;
            
            int main()
            
            {
            double h,t,s;
            cin>>h>>t;
            s=h;
            
            

            for(int i=0;i<t-1;i++) { s=s+2*(h/2.0); h=h/2.0; } cout<<fixed<<setprecision(6)<<s;

            return 0;

            
            }
            
            
            
            
            • 0
              @ 2024-1-11 13:40:15

              #include<bits/stdc++.h> using namespace std; int main() { double a,b,n,m; cin>>a>>b; m=a; for(n=0;b-1>0;) { n=n+a; a=a/2.0; b=b-1; } cout<<fixed<<setprecision(6)<<n+m; return 0; }

              • 0
                @ 2024-1-8 13:49:52

                #include<bits/stdc++.h> using namespace std; int main() { double a,b,n,m; cin>>a>>b; m=a; for(n=0;b-1>0;) { n=n+a; a=a/2.0; b=b-1; } cout<<fixed<<setprecision(6)<<n+m; return 0; }

                • 1

                信息

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