mirror of
https://github.com/krahets/hello-algo.git
synced 2025-07-19 20:55:57 +08:00
build
This commit is contained in:
@ -343,7 +343,7 @@ comments: true
|
||||
int choices[2] = {1, 2}; // 可选择向上爬 1 或 2 阶
|
||||
int state = 0; // 从第 0 阶开始爬
|
||||
int *res = (int *)malloc(sizeof(int));
|
||||
*res = 0; // 使用 res[0] 记录方案数量
|
||||
*res = 0; // 使用 res[0] 记录方案数量
|
||||
int len = sizeof(choices) / sizeof(int);
|
||||
backtrack(choices, state, n, res, len);
|
||||
int result = *res;
|
||||
|
Reference in New Issue
Block a user