Problem beareatrabbit
User RandomCtfNoob
Submission Time 2026-01-07 16:39:44
Score 0
Max Time N/A
Max Memory N/A

Compile Error

beareatrabbit.cpp: In function ‘int loopy(int, int, std::stack<int>)’:
beareatrabbit.cpp:5:13: error: no match for ‘operator[]’ (operand types are ‘std::stack<int>’ and ‘int’)
5 | if (rabbits[targetpos] == -1){
| ^
beareatrabbit.cpp:6:13: error: expected ‘;’ before ‘}’ token
6 | return ans
| ^
| ;
7 | }
| ~
beareatrabbit.cpp:10:30: error: no match for ‘operator[]’ (operand types are ‘std::stack<int>’ and ‘int’)
10 | if (targetpos > 0 && rabbits[targetpos-1] ~= -1){
| ^
beareatrabbit.cpp:10:43: error: expected ‘)’ before ‘~’ token
10 | if (targetpos > 0 && rabbits[targetpos-1] ~= -1){
| ~ ^~
| )
beareatrabbit.cpp:11:19: error: no match for ‘operator[]’ (operand types are ‘std::stack<int>