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

Compile Error

binarysearch.cpp: In function ‘int main()’:
binarysearch.cpp:7:1: error: expected initializer before ‘cin’
7 | cin>>n>>q
| ^~~
binarysearch.cpp:10:6: error: ‘a’ was not declared in this scope
10 | cin>>a[i];}
| ^
binarysearch.cpp:11:6: error: ‘a’ was not declared in this scope
11 | sort(a,a+n);
| ^
binarysearch.cpp:12:15: error: ‘q’ was not declared in this scope
12 | for(int i=0;i<q;i++){
| ^
binarysearch.cpp:23:5: error: expected primary-expression before ‘}’ token
23 | else}
| ^
binarysearch.cpp: At global scope:
binarysearch.cpp:27:1: error: ‘cout’ does not name a type
27 | cout<<left<<'\n';
| ^~~~
binarysearch.cpp:28:1: error: expected declaration before ‘}’ token
28 | }
| ^
binarysearch.cpp:29:1: error: expected declaration before ‘}’ token
29 | }
| ^