Problem binarysearch
User suzienguyen
Submission Time 2026-02-17 16:43:36
Score 0
Max Time N/A
Max Memory N/A

Compile Error

binarysearch.cpp:7:27: error: expected ‘,’ or ‘...’ before ‘&’ token
7 | int binsearch(vector<int>A&, int k){
| ^
binarysearch.cpp: In function ‘int binsearch(std::vector<int>)’:
binarysearch.cpp:13:15: error: ‘k’ was not declared in this scope
13 | if ((A[mid]<k)&&(A[mid+1]>=k)){
| ^
binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:40:22: error: too many arguments to function ‘int binsearch(std::vector<int>)’
40 | ans = binsearch(A,x);
| ^
binarysearch.cpp:7:5: note: declared here
7 | int binsearch(vector<int>A&, int k){
| ^~~~~~~~~