5 solutions

  • 2
    @ 2022-1-5 16:44:10

    若卡住 延长梯形两斜边构成一个大的等腰三角形采用相似三角形解题

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	double r,a,b,h;
    	cin>>r>>a>>b>>h;
    	if(b>=2*r){
    		cout<<"Drop";
    		return 0;
    	}else{
    		cout<<"Stuck"<<endl;
    		double x=(h*b)/(a-b);
    		double n=sqrt(h*h+(a-b)*(a-b)/4);
    		double p=(r*n)/((a-b)/2)-x;
    		printf("%0.10lf",p);
    	}
    }
    

    Information

    ID
    127
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    # Submissions
    140
    Accepted
    59
    Uploaded By