Problem | typicalstairs |
---|---|
User | ShiYuXiang |
Submission Time | 2023-10-30 16:30:45 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
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,memo) + stairs(idx-2,memo);
| ^~~~
typicalstairs.cpp: In function ‘int main()’:
typicalstairs.cpp:16:8: error: structured binding declaration cannot have type ‘int’
16 | int[N] memo;
| ^~~
typicalstairs.cpp:16:8: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’
typicalstairs.cpp:16:9: error: conflicting declaration ‘auto N’
16 | int[N] memo;
| ^
typicalstairs.cpp:14:9: note: previous declaration as ‘int N’
14