Problem arrayfind
User godex
Submission Time 2025-02-19 17:15:41
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayfind.cpp: In function ‘int32_t main()’:
arrayfind.cpp:18:20: error: ‘r’ was not declared in this scope
18 | int l = 0; r = q - 1;
| ^
arrayfind.cpp:25:17: error: expected ‘}’ before ‘else’
25 | else r = mid - 1;
| ^~~~
arrayfind.cpp:22:28: note: to match this ‘{’
22 | if (a[mid] < x){
| ^
arrayfind.cpp:29:27: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
29 | cout << "Smaller:" << ans + 1 << ", "
| ^~~
| abs
arrayfind.cpp:33:16: error: ‘l’ was not declared in this scope
33 | while (l <= r){
| ^
arrayfind.cpp:33:21: error: ‘r’ was not declared in this scope
33 | while (l <= r){
| ^
arrayfind.cpp:35:18: error: ‘mid’ wa