95pts求调
查看原帖
95pts求调
1037554
hetao5422877楼主2024/11/4 21:12

rt

#include<bits/stdc++.h>
using namespace std;
int main() 
{
    double s,x,p=0.0,d=7.0;
    cin>>s>>x;
    while (1) 
    {
        p+=d;  
        if (p>=s-x&&p<=s+x) 
        {
            double nd=d*0.98,np=p+nd;  
            if (np>=s-x&&np<=s+x) 
            {
                cout<<"y";
                return 0;
            }
        }
        d*=0.98;
        if (d<1e-6) 
        {
            break;
        }
    }
    cout <<"n";
    return 0;
}
2024/11/4 21:12
加载中...