Problem typicalstairs
User ShiYuXiang
Submission Time 2023-11-07 10:35:51
Score 0
Max Time N/A
Max Memory N/A

Compile Error

typicalstairs.cpp:4:26: error: declaration of ‘memo’ as array of references
4 | int stairs(int idx, int& memo[]){
| ^~~~
typicalstairs.cpp: In function ‘int stairs(...)’:
typicalstairs.cpp:5:9: error: ‘memo’ was not declared in this scope
5 | if (memo[idx] > -1) return memo[idx];
| ^~~~
typicalstairs.cpp:5:14: error: ‘idx’ was not declared in this scope; did you mean ‘index’?
5 | if (memo[idx] > -1) return memo[idx];
| ^~~
| index
typicalstairs.cpp:8:5: error: ‘memo’ was not declared in this scope
8 | memo[idx] = stairs(idx-1,memo) + stairs(idx-2,memo);
| ^~~~
typicalstairs.cpp:8:10: error: ‘idx’ was not declared in this scope; did you mean ‘index’?
8 | memo[idx] = stairs(idx-1,memo) + stairs(idx-2,memo);
| ^~~
| index