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.

36 lines
928 B

2 years ago
/*
N13
N
N=334
111
12
21
3
*/
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[N];
int res;
int n;
/**
* @brief
*
* @param step
* @param r
*/
void dfs(int u, int r) {
if (r == 0) res++; //剩余为0就得到一组答案
//本轮运几件
for (int i = 1; i <= 3; i++)
if (r - i >= 0) dfs(u + 1, r - i);
}
int main() {
cin >> n;
dfs(0, n);
printf("%d", res);
return 0;
}