stations.cpp:173:6: error: ambiguating new declaration of 'void subtask2DP(const std::vector<std::pair<int, int> >&, std::vector<long long int>&, int, int)'
173 | void subtask2DP(const vector<pair<int,int>> &a, vector<long long>& dp, int e1, int e2) {
| ^~~~~~~~~~
stations.cpp:33:11: note: old declaration 'long long int subtask2DP(const std::vector<std::pair<int, int> >&, std::vector<long long int>&, int, int)'
33 | long long subtask2DP(const vector<pair<int,int>>&, vector<long long>&, int, int);
| ^~~~~~~~~~
stations.cpp: In function 'void subtask2DP(const std::vector<std::pair<int, int> >&, std::vector<long long int>&, int, int)':
stations.cpp:175:44: error: no match for 'operator-' (operand types are 'const value_type' {aka 'const std::pair<int, int>'} and 'const value_type' {aka 'const std::pair<int, int>'})
175 | for(int i=0; i<=e1; i++) sum1 += a[e1] - a[i];
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
577 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: template argument deduction/substitution failed:
stations.cpp:175:49: note: 'const value_type' {aka 'const std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
175 | for(int i=0; i<=e1; i++) sum1 += a[e1] - a[i];
| ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
1693 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: template argument deduction/substitution failed:
stations.cpp:175:49: note: 'const value_type' {aka 'const std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>'
175 | for(int i=0; i<=e1; i++) sum1 += a[e1] - a[i];
| ^
stations.cpp:177:22: error: no match for 'operator-' (operand types are 'const value_type' {aka 'const std::pair<int, int>'} and 'const value_type' {aka 'const std::pair<int, int>'})
177 | sum2 += a[i] - a[e1+1];
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
577 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: template argument deduction/substitution failed:
stations.cpp:177:30: note: 'const value_type' {aka 'const std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
177 | sum2 += a[i] - a[e1+1];
| ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
1693 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: template argument deduction/substitution failed:
stations.cpp:177:30: note: 'const value_type' {aka 'const std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>'
177 | sum2 += a[i] - a[e1+1];
| ^
stations.cpp:178:30: error: no matching function for call to 'max(long long int&, int)'
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ~~~^~~~~~~~
In file included from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
254 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/11/bits/stl_algobase.h:254:5: note: template argument deduction/substitution failed:
stations.cpp:178:30: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ~~~^~~~~~~~
In file included from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/11/bits/stl_algobase.h:300:5: note: template argument deduction/substitution failed:
stations.cpp:178:30: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ~~~^~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
from stations.cpp:7:
/usr/include/c++/11/bits/stl_algo.h:3461:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
3461 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/11/bits/stl_algo.h:3461:5: note: template argument deduction/substitution failed:
stations.cpp:178:30: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ~~~^~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
from stations.cpp:7:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: template argument deduction/substitution failed:
stations.cpp:178:30: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ~~~^~~~~~~~
stations.cpp:178:47: error: no match for 'operator-' (operand types are 'const value_type' {aka 'const std::pair<int, int>'} and 'const value_type' {aka 'const std::pair<int, int>'})
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)'
577 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:577:5: note: template argument deduction/substitution failed:
stations.cpp:178:52: note: 'const value_type' {aka 'const std::pair<int, int>'} is not derived from 'const std::reverse_iterator<_Iterator>'
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ^
In file included from /usr/include/c++/11/bits/stl_algobase.h:67,
from /usr/include/c++/11/vector:60,
from stations.cpp:4:
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)'
1693 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/11/bits/stl_iterator.h:1693:5: note: template argument deduction/substitution failed:
stations.cpp:178:52: note: 'const value_type' {aka 'const std::pair<int, int>'} is not derived from 'const std::move_iterator<_IteratorL>'
178 | dp[i] = sum1+sum2+max(n,i-e1)*(a[e1+1]-a[e1]);
| ^
stations.cpp: In function 'long long int subtask4(std::vector<int>, std::vector<int>)':
stations.cpp:130:1: warning: control reaches end of non-void function [-Wreturn-type]
130 | }
| ^