Problem | oddqueries |
---|---|
User | CuriousFox |
Submission Time | 2025-05-07 15:28:15 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
oddqueries.cpp: In function ‘int main()’:
oddqueries.cpp:19:3: error: ‘ans’ was not declared in this scope; did you mean ‘abs’?
19 | ans = sums - accumulate(nums[l], nums[r+1], 0) + ((r-l+1)*k);
| ^~~
| abs
In file included from /usr/include/c++/9/numeric:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:84,
from oddqueries.cpp:1:
/usr/include/c++/9/bits/stl_numeric.h: In instantiation of ‘_Tp std::accumulate(_InputIterator, _InputIterator, _Tp) [with _InputIterator = long long int; _Tp = int]’:
oddqueries.cpp:19:48: required from here
/usr/include/c++/9/bits/stl_numeric.h:139:41: error: invalid type argument of unary ‘*’ (have ‘long long int’)
139 | __init = _GLIBCXX_MOVE_IF_20(__init) + *__first;
| ^~~~~~~~