Problem binarysearch
User Yuhmama
Submission Time 2026-06-25 14:52:28
Score 0
Max Time N/A
Max Memory N/A

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:13:17: error: ‘n’ was not declared in this scope
13 | int l = 0, r = n-1, ans = -1;
| ^
binarysearch.cpp:16:6: error: ‘arr’ was not declared in this scope
16 | if(arr[mid] >= x){
| ^~~
binarysearch.cpp:16:18: error: ‘x’ was not declared in this scope
16 | if(arr[mid] >= x){
| ^
binarysearch.cpp:17:10: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
17 | ans = mid;
| ^~~
| abs
binarysearch.cpp:24:9: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
24 | cout << ans << '\n';
| ^~~
| abs