Problem arrayngement
User Arjunironman8
Submission Time 2026-06-26 15:02:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

arrayngement.cpp: In function ‘int main()’:
arrayngement.cpp:15:17: error: ‘n’ was not declared in this scope
15 | int l = 0, r = n-1, ans = -1;
| ^
arrayngement.cpp:18:5: error: ‘arr’ was not declared in this scope
18 | if(arr[mid] >= x){
| ^~~
arrayngement.cpp:19:15: error: no match for ‘operator=’ (operand types are ‘std::vector<long long int>’ and ‘long long int’)
19 | ans = mid;
| ^~~
In file included from /usr/include/c++/9/vector:72,
from /usr/include/c++/9/functional:62,
from /usr/include/c++/9/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/9/algorithm:71,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from arrayngement.cpp:1:
/usr/include/c++/9/bits/vector.tcc:198:5: note: candidate: ‘std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::op