liguorui2022 @ 2022-12-25 22:06:51
#include<bits/stdc++.h>
using namespace std;
int main()
{
double ans=0,i,k;
cin>>k;
for(i=1;i<=2000000;i++)//为什吗要开这吗大
{
if(ans>k)
{
cout<<i-1;
return 0;
}
ans+=1/i;
}
return 0;
}
by liguorui2022 @ 2022-12-25 22:09:54
题目中不是说了k<=15吗
by Ja50nY0un9_as_AgNO3 @ 2022-12-25 22:10:55
@caulbm
这个答案增长速度快得离谱,
by liguorui2022 @ 2022-12-25 22:12:35
哦,知道了谢谢@Ja50nY0un9
by Ruiqun2009 @ 2022-12-25 22:15:34
@caulbm 增长速度是指数级别的,因为调和级数前缀和为
by liguorui2022 @ 2022-12-26 10:57:45
哦 懂了