太逊了!根本不用sqrt()好吧

刘嘉柚  •  6个月前


include<bits/stdc++.h>

using namespace std; int main() {

int a,i=0;
cin>>a;
while(i*i<=a){
	i++;
}
cout<<i-1;
return 0;

}


评论:


刘嘉柚  •  6个月前

太逊啦,一点都不精简

#include<cstdio>
int main(){
	int n,i=2; 
	scanf("%d",&n);
	while(i*i<=n) i++;
	printf("%d",i-1);
	return 0;
}

黄戈  •  6个月前

两个丛林土鳖,死开让我来

include<bits/stdc++.h>

using namespace std; int main() {

int a;
cin>>a; 
cout<<int(sqrt(a))<<endl;

}


魈凯KBS  •  6个月前

666


林汐  •  4个月前

如果不允许用sqrt,并且x跳到10^18你会做吗?不会做就不要瞎逼逼


吴晨曦  •  2个月前

L Damn


刘嘉柚  •  2个月前

sqrt()函数是 O(1) 查询;

这位神犇的代码却真的是 O( sqrt(n) )...

谁比较逊一眼就看得出来好吧


凌艺樽  •  1个月前