第2个WA 求大佬看看 谢谢
查看原帖
第2个WA 求大佬看看 谢谢
599362
Lichen081103楼主2022/9/1 21:37
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int s=0,now=0;
	int x=0;
	double speed=7;
	cin>>s>>x;
	int l=s-x,r=s+x;
	while(true){
		now+=speed;
		speed*=0.98;
		if(now>r){
			cout<<'n';
			break;
		}
		if(l<=now && now<=r){
			if(now+speed>r){
				cout<<'n';
				break;
			}else{
				cout<<'y';
				break;
			}
		}
	} 
	
	return 0;
}
2022/9/1 21:37
加载中...