You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
392 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <bits/stdc++.h>
/*
测试用例I
3 7
答案5
测试用例II
4 15
答案144
测试用例III
1 22
答案17711
*/
using namespace std;
int n, m;
int f[110];
int main() {
cin >> n >> m;
f[2] = 1, f[3] = 2;
for (int i = 4; i <= m - n + 1; i++) f[i] = f[i - 1] + f[i - 2];
printf("%d\n", f[m - n + 1]);
return 0;
}