shzuaeno @ 2020-08-23 20:51:56
已经写出来了,就是不会用高精
#include<stdio.h>
#include<stdlib.h>
int loti(int i)
{
if(i==1)
{
return 1;
}
else
{
return loti(i-1)+loti(i-2);
}
}
int main()
{
int l,t;
scanf("%d",&l);
t=loti(l);
printf("%d",t);
return 0;
}
by 江户川·萝卜 @ 2020-08-23 21:02:37
@konjacq 其他分还是有的啊,也可能是数据没有
by konjacq @ 2020-08-23 21:02:56
@Zhaoyuhang2008 应该是一个点都过不了才对,他那个loti(int i)
边界i==2
没判
by JRzyh @ 2020-08-23 21:03:08
我P2020已经写出来了,就是不会优化((((
by 江户川·萝卜 @ 2020-08-23 21:04:09
啊这,对哦
by JRzyh @ 2020-08-23 21:05:36
https://www.luogu.com.cn/record/37543250
应该十分,有个点n=1
by JRzyh @ 2020-08-23 21:06:52
#include<stdio.h>
#include<stdlib.h>
int loti(int i)
{
if(i<3)
{
return 1;
}
else
{
return loti(i-1)+loti(i-2);
}
}
int main()
{
int l,t;
scanf("%d",&l);
l=l+1;
t=loti(l);
printf("%d",t);
return 0;
}
真实求助代码
by yizhidaimazhu @ 2020-09-09 19:41:37
高精度可以写的哇 高精之后直接递推就ok了