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

Compile Error

arrayngement.cpp: In function ‘int main()’:
arrayngement.cpp:15:22: error: conflicting declaration ‘long long int ans’
15 | int l = 0, r = x-1, ans = -1;
| ^~~
arrayngement.cpp:14:14: note: previous declaration as ‘std::vector<long long int> ans’
14 | vector<int> ans;
| ^~~
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,