| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1295826 | fairkrash | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++20 | Compilation error | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = int;
ll INF = 1e9;
ll MOD = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
ll n;
cin >> n;
string s;
cin >> s;
ll v1 = 0, v2 = 0, v3 = 0;
vector<ll> d1, d2, d3;
for (ll i = 0; i < s.size(); i++) {
if (s[i] == 'R') {
v1++;
d1.push_back(i);
}
if (s[i] == 'G') {
v2++;
d2.push_back(i);
}
if (s[i] == 'Y') {
v3++;
d3.push_back(i);
}
}
ll mx = max({v1, v2, v3});
if (mx > n - mx + 1) {
cout << -1;
return 0;
}
vector<vector<vector<vector<ll>>>> dp(v1 + 2,
vector<vector<vector<ll>>>(v2 + 2,
vector<vector<ll>>(v3 + 2, vector<ll>(3, INF))));
dp[1][0][0][0] = 0;
dp[0][1][0][1] = 0;
dp[0][0][1][2] = 0;
for (ll a = 0; a <= v1; a++) {
for (ll b = 0; b <= v2; b++) {
for (ll c = 0; c <= v3; c++) {
if (a + b + c == 0)continue;
for (ll e = 0; e < 3; e++) {
for (ll j = 0; j < 3; j++) {
if (j == e) continue;
if (j == 0) {
if (a == v1)continue;
ll k = d1[a];
ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
dp[a + 1][b][c][j] = min(dp[a + 1][b][c][j], dp[a][b][c][e] + h1 + h2 + h3);
}
if (j == 1) {
if (b == v2)continue;
ll k = d2[b];
ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
dp[a][b + 1][c][j] = min(dp[a][b + 1][c][j], dp[a][b][c][e] + h1 + h2 + h3);
}
if (j == 2) {
if (c == v3)continue;
ll k = d3[c];
ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
dp[a][b][c + 1][j] = min(dp[a][b][c + 1][j], dp[a][b][c][e] + h1 + h2 + h3);
}
}
}
}
}
}
cout << min({dp[v1][v2][v3][0], dp[v1][v2][v3][1], dp[v1][v2][v3][2]});
}
Compilation message (stderr)
joi2019_ho_t3.cpp: In function 'int main()':
joi2019_ho_t3.cpp:54:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
54 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
from joi2019_ho_t3.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:54:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
54 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:54:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
54 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:54:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
54 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:54:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
54 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:55:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
55 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:55:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
55 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:55:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
55 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:55:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
55 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:55:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
55 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:56:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
56 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:56:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
56 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:56:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
56 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:56:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
56 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:56:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
56 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:62:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
62 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:62:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
62 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:62:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
62 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:62:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
62 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:62:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
62 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:63:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
63 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:63:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
63 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:63:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
63 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:63:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
63 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:63:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
63 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:64:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
64 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:64:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
64 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:64:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
64 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:64:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
64 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:64:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
64 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:70:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
70 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:70:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
70 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:70:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
70 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:70:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
70 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:70:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
70 | ll h1 = max(a - (upper_bound(d1.begin(), d1.end(), k) - d1.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:71:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
71 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:71:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
71 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:71:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
71 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:71:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
71 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:71:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
71 | ll h2 = max(b - (upper_bound(d2.begin(), d2.end(), k) - d2.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:72:40: error: no matching function for call to 'max(__gnu_cxx::__normal_iterator<int*, std::vector<int> >::difference_type, long long int)'
72 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:72:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
72 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:72:40: note: deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
72 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5795 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5795:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:72:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
72 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5805 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algo.h:5805:5: note: template argument deduction/substitution failed:
joi2019_ho_t3.cpp:72:40: note: mismatched types 'std::initializer_list<_Tp>' and 'long int'
72 | ll h3 = max(c - (upper_bound(d3.begin(), d3.end(), k) - d3.begin()), 0ll);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~