Problem rotate
User JoshJuice
Submission Time 2025-05-25 21:56:19
Score 0
Max Time N/A
Max Memory N/A

Compile Error

rotate.cpp: In function ‘void energy(int, vi)’:
rotate.cpp:38:82: error: no matching function for call to ‘rotate(std::vector<int>, int)’
38 | rotate([&](){ vi t(n); iota(ALL(t), 0); return t; }(), (50000 - v[n/2]) % 50000);
| ^
In file included from /usr/include/c++/9/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
from rotate.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:1440:5: note: candidate: ‘template<class _FIter> _FIter std::_V2::rotate(_FIter, _FIter, _FIter)’
1440 | rotate(_ForwardIterator __first, _ForwardIterator __middle,
| ^~~~~~
/usr/include/c++/9/bits/stl_algo.h:1440:5: note: template argument deduction/substitution failed:
rotate.cpp:38:82: note: deduced conflicting types for parameter ‘_FIter’ (‘std::vector<int>’ and ‘int’)
38 | rotate([&](){ vi t