Files
python/TangDou/LanQiaoBei/LanQiao14STEMA202211/4_1.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

30 lines
392 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
}