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

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:12:18: error: invalid operands of types ‘int [N]’ and ‘int’ to binary ‘operator*’
12 | sort(arr, arr*N);
| ~~~^~
| | |
| | int
| int [N]
binarysearch.cpp:17:31: error: ‘n’ was not declared in this scope
17 | int left = 0; right = n; mid;
| ^
binarysearch.cpp:17:34: error: ‘mid’ was not declared in this scope
17 | int left = 0; right = n; mid;
| ^~~
binarysearch.cpp:19:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | while ( left < right ) {
| ^~~~~
binarysearch.cpp:20:37: error: invalid operands of types ‘std::ios_base& (*)(std::ios_base&)’ and ‘int’ to binary ‘operator/’
20 | int mid = (left + rig