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

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:19:26: error: assignment of function ‘std::ios_base& std::right(std::ios_base&)’
19 | int left=0; right= n-1; mid;
| ~~~~~^~~~~
binarysearch.cpp:19:33: error: ‘mid’ was not declared in this scope
19 | int left=0; right= n-1; mid;
| ^~~
binarysearch.cpp:21:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
21 | while(left < right) {
| ^~~~~
binarysearch.cpp:22:37: error: invalid operands of types ‘std::ios_base& (*)(std::ios_base&)’ and ‘int’ to binary ‘operator/’
22 | int mid = (left + right)/2;
| ~~~~~~~~~~~~~~^~
| | |
| | int
| std::ios_base& (*)(std::ios_base&)
bina