一只小蜜蜂 HDU2044
每一步都可以加1或者加2,那么走到b的时候应该是b-1和b-2加起来,即递推方程是dp[b] = dp[b-1]+dp[b-2]
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define int long long
int a,b;
void solve(){
cin>>a>>b;
b -= a ; //第几项
int x = 0,y = 1,z = 1;
for(int i = 1;i <= b;++i)
z = x + y,x = y,y = z;
cout<<z<<"\n";
}
signed main(){
IOS;
int tt;cin>>tt;
while(tt--)
solve();
return 0;
}