Problem carpark
User undefinedcritter
Submission Time 2026-08-03 23:05:43
Score 0
Max Time N/A
Max Memory N/A

Compile Error

carpark.cpp: In function ‘int main()’:
carpark.cpp:18:38: error: expected primary-expression before ‘)’ token
18 | if (cars == 1) {cout << 1; return 1;)
| ^
carpark.cpp:26:4: error: ‘spaces’ was not declared in this scope
26 | spaces[j]++;
| ^~~~~~
carpark.cpp:29:10: error: ‘spaces’ was not declared in this scope
29 | sort(spaces.begin(),spaces.end());
| ^~~~~~
carpark.cpp:30:23: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator+’
30 | int answer = index+1;
| ~~~~~^~
carpark.cpp:34:23: error: ‘M’ was not declared in this scope
34 | if (S==1) { answer = M-m+1; }
| ^
carpark.cpp:34:25: error: ‘m’ was not declared in this scope
34 | if (S==1) { answer = M-m+1; }
| ^
carpark.cpp:36:1: error: e