Problem binarysearch
User andikawahyudi
Submission Time 2026-06-25 14:33:04
Score 0
Max Time N/A
Max Memory N/A

Compile Error

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