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

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:5:2: error: ‘vector’ was not declared in this scope
5 | vector {A,A,A,A}
| ^~~~~~
binarysearch.cpp:2:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
1 | #include <iostream>
+++ |+#include <vector>
2 | using namespace std;
binarysearch.cpp:6:2: error: ‘vec’ was not declared in this scope
6 | vec.size(N)
| ^~~
binarysearch.cpp:6:11: error: ‘N’ was not declared in this scope
6 | vec.size(N)
| ^
binarysearch.cpp:10:9: error: ‘l’ was not declared in this scope
10 | while (l => r) {int mid = (l + r) / 2;
| ^
binarysearch.cpp:10:12: error: expected primary-expression before ‘>’ token
10 | while (l => r) {int mid = (l + r) / 2;
| ^
binarysearch.cpp:10:14: error: ‘r’ was not declared in this scope
1