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

Compile Error

typicalstairs.cpp:4:28: error: expected ‘,’ or ‘...’ before ‘memo’
4 | void stairs(int idx, int[] memo){
| ^~~~
typicalstairs.cpp: In function ‘void 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:5:40: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
5 | if (memo[idx] > -1) return memo[idx];
| ^
typicalstairs.cpp:6:31: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
6 | else if( idx == 1) return 1;
| ^
typicalstairs.cpp:7:31: error: return-statement with a value, in function returning ‘void’ [-fpermissive]
7 | else if (idx == 2) return 2;
| ^
typicalstairs.cpp:8:5: