蒟蒻赛时0pts模拟代码求条
查看原帖
蒟蒻赛时0pts模拟代码求条
1268524
DX3906_ourstar楼主2024/11/29 22:23

rt

#include<iostream>
#include<algorithm>
#include<cstring> 

using namespace std;

int T;
double k;

inline void cz(double &r){
	double tmp=(int)r + 1;
	r*=tmp;
	return ;
}

inline bool ok(double x){
	return (int)x==x;
}

inline void work(){
	cin>>k;
	double r=k+0.5;
	int ans=0;
	while(!ok(r)){
		cz(r);
		++ans;
		if(ans>10000){
			puts("NO!");
			return ;
		}
	}
	cout<<ans<<"\n";
	return ;
}

signed main(){
	cin>>T;
	while(T--)work();
	return 0;
}
2024/11/29 22:23
加载中...