Problem binarysearch
User abdullahmazlan13
Submission Time 2026-06-25 15:56:00
Score 0
Max Time N/A
Max Memory N/A

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:12:16: error: expected ‘;’ before ‘int’
12 | cin >> vec [A]
| ^
| ;
13 |
14 | int l = 0, r = n-1, ans = -1;
| ~~~
binarysearch.cpp:15:9: error: ‘l’ was not declared in this scope
15 | while (l => r) {int mid = (l + r) / 2;
| ^
binarysearch.cpp:15:12: error: expected primary-expression before ‘>’ token
15 | while (l => r) {int mid = (l + r) / 2;
| ^
binarysearch.cpp:15:14: error: ‘r’ was not declared in this scope
15 | while (l => r) {int mid = (l + r) / 2;
| ^
binarysearch.cpp:16:6: error: ‘arr’ was not declared in this scope
16 | if (arr [mid] >= x){
| ^~~
binarysearch.cpp:16:19: error: ‘x’ was not declared in this scope
16 | if (arr [mid] >= x){
| ^
binaryse