'commit'
This commit is contained in:
36
TangDou/LanQiaoBei/LanQiao14STEMA202211/4_2.cpp
Normal file
36
TangDou/LanQiaoBei/LanQiao14STEMA202211/4_2.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
/*
|
||||
测试用例I:
|
||||
3 7
|
||||
|
||||
答案:5
|
||||
|
||||
测试用例II:
|
||||
4 15
|
||||
|
||||
答案:144
|
||||
|
||||
测试用例III:
|
||||
1 22
|
||||
|
||||
答案:17711
|
||||
*/
|
||||
using namespace std;
|
||||
int n, m;
|
||||
int cnt;
|
||||
void dfs(int u) {
|
||||
if (u > m) return;
|
||||
if (u == m) {
|
||||
cnt++;
|
||||
return;
|
||||
}
|
||||
dfs(u + 1);
|
||||
dfs(u + 2);
|
||||
}
|
||||
int main() {
|
||||
cin >> n >> m;
|
||||
dfs(n);
|
||||
printf("%d\n", cnt);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user