tea.cpp:8:6: error: variable or field 'upd' declared void
8 | void upd(data &a, const data &b)
| ^~~
tea.cpp:8:10: error: reference to 'data' is ambiguous
8 | void upd(data &a, const data &b)
| ^~~~
In file included from /usr/include/c++/10/string:54,
from /usr/include/c++/10/bits/locale_classes.h:40,
from /usr/include/c++/10/bits/ios_base.h:41,
from /usr/include/c++/10/ios:42,
from /usr/include/c++/10/istream:38,
from /usr/include/c++/10/sstream:38,
from /usr/include/c++/10/complex:45,
from /usr/include/c++/10/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
from tea.cpp:1:
/usr/include/c++/10/bits/range_access.h:319:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)'
319 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:310:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
310 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/10/bits/range_access.h:300:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
300 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/10/bits/range_access.h:290:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
290 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
tea.cpp:7:8: note: 'struct data'
7 | struct data { int cnt, mini, pv; };
| ^~~~
tea.cpp:8:16: error: 'a' was not declared in this scope
8 | void upd(data &a, const data &b)
| ^
tea.cpp:8:19: error: expected primary-expression before 'const'
8 | void upd(data &a, const data &b)
| ^~~~~
tea.cpp: In function 'int main()':
tea.cpp:22:16: error: template argument 1 is invalid
22 | vector<data> dp(n+1);
| ^
tea.cpp:22:16: error: template argument 2 is invalid
tea.cpp:24:7: error: invalid types 'int[int]' for array subscript
24 | dp[v[1].a] = { 1, v[1].a, 0 };
| ^
tea.cpp:27:11: error: invalid types 'int[int]' for array subscript
27 | dp[i] = { dp[i-1].cnt, dp[i-1].mini, dp[i-1].pv };
| ^
tea.cpp:27:21: error: invalid types 'int[int]' for array subscript
27 | dp[i] = { dp[i-1].cnt, dp[i-1].mini, dp[i-1].pv };
| ^
tea.cpp:27:34: error: invalid types 'int[int]' for array subscript
27 | dp[i] = { dp[i-1].cnt, dp[i-1].mini, dp[i-1].pv };
| ^
tea.cpp:27:48: error: invalid types 'int[int]' for array subscript
27 | dp[i] = { dp[i-1].cnt, dp[i-1].mini, dp[i-1].pv };
| ^
tea.cpp:28:15: error: invalid types 'int[int]' for array subscript
28 | if (dp[i-1].mini * 1ll * dp[i-1].cnt == (ll)i) dp[i].mini++;
| ^
tea.cpp:28:36: error: invalid types 'int[int]' for array subscript
28 | if (dp[i-1].mini * 1ll * dp[i-1].cnt == (ll)i) dp[i].mini++;
| ^
tea.cpp:28:58: error: invalid types 'int[int]' for array subscript
28 | if (dp[i-1].mini * 1ll * dp[i-1].cnt == (ll)i) dp[i].mini++;
| ^
tea.cpp:30:19: error: invalid types 'int[int]' for array subscript
30 | upd(dp[i], { dp[j-1].cnt+1, max(dp[j-1].mini, i-j+1), j-1 });
| ^
tea.cpp:30:28: error: invalid types 'int[int]' for array subscript
30 | upd(dp[i], { dp[j-1].cnt+1, max(dp[j-1].mini, i-j+1), j-1 });
| ^
tea.cpp:30:47: error: invalid types 'int[int]' for array subscript
30 | upd(dp[i], { dp[j-1].cnt+1, max(dp[j-1].mini, i-j+1), j-1 });
| ^
tea.cpp:30:13: error: 'upd' was not declared in this scope
30 | upd(dp[i], { dp[j-1].cnt+1, max(dp[j-1].mini, i-j+1), j-1 });
| ^~~
tea.cpp:33:15: error: invalid types 'int[int]' for array subscript
33 | cout << dp[n].cnt << "\n";
| ^
tea.cpp:38:19: error: invalid types 'int[int]' for array subscript
38 | int l = dp[r].pv;
| ^