Problem binarysearch
User Jaysonwee22
Submission Time 2026-06-25 15:13:47
Score 0
Max Time N/A
Max Memory N/A

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:17:23: error: assignment of function ‘std::ios_base& std::right(std::ios_base&)’
17 | int left = 0; right = n, mid;
| ~~~~~~^~~
binarysearch.cpp:17:28: error: ‘mid’ was not declared in this scope
17 | int left = 0; right = n, mid;
| ^~~
binarysearch.cpp:19:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | while (left < right) {
| ^~~~~
binarysearch.cpp:20:19: error: invalid conversion from ‘std::ios_base& (*)(std::ios_base&)’ to ‘int’ [-fpermissive]
20 | mid = (left = right)/1;
| ^~~~~
| |
| std::ios_base& (*)(std::ios_base&)
binarysearch.cpp:29:22: error: expected ‘}’ at end of input
29 | cout << left << '\n';
| ^
binarysea