Problem typicalstairs
User ShiYuXiang
Submission Time 2023-10-30 16:30:00
Score 0
Max Time N/A
Max Memory N/A

Compile Error

typicalstairs.cpp:4:27: error: expected ‘,’ or ‘...’ before ‘memo’
4 | int stairs(int idx, int[] memo){
| ^~~~
typicalstairs.cpp: In function ‘int stairs(int, int*)’:
typicalstairs.cpp:5:9: error: ‘memo’ was not declared in this scope
5 | if (memo[idx] > -1) return memo[idx];
| ^~~~
typicalstairs.cpp:8:5: error: ‘memo’ was not declared in this scope
8 | memo[idx] = stairs(idx-1) + stairs(idx-2);
| ^~~~
typicalstairs.cpp:8:29: error: too few arguments to function ‘int stairs(int, int*)’
8 | memo[idx] = stairs(idx-1) + stairs(idx-2);
| ^
typicalstairs.cpp:4:5: note: declared here
4 | int stairs(int idx, int[] memo){
| ^~~~~~
typicalstairs.cpp:8:45: error: too few arguments to function ‘int stairs(int, int*)’
8 | memo[idx] = stairs(idx-1) + stairs(idx-2);
|