package suanfa_xiaoqiang1;
import java.math.BigInteger;
import java.util.Scanner;
public class P2437 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int m=sc.nextInt();
int n=sc.nextInt();
dfs(m,n);
}
public static void dfs(int m,int n) {//用递归会太慢,需用递推
int nn=n-m;
BigInteger[] s=new BigInteger[n+1];
if (nn>=1) {
s[1]=BigInteger.ONE;
}
if (nn>=2) {
s[2]=BigInteger.valueOf(2);
}
for (int i = 3; i <= nn; i++) {
s[i]=s[i-1].add(s[i-2]);
}
System.out.println(s[nn]);
}
}
递推求解:改变输入的m和n之间的范围
斐波那契的第100010001000项有约1e3001e3001e300,也就是111后面跟着300300300个000,必须要用高精度