bridges.cpp: In function 'void __union__(int, int)':
bridges.cpp:29:33: error: reference to 'size' is ambiguous
29 | if (u != v) root[u] = v,size[v] += size[u];
| ^~~~
In file included from /usr/include/c++/13/string:53,
from /usr/include/c++/13/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
from bridges.cpp:1:
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:29:44: error: reference to 'size' is ambiguous
29 | if (u != v) root[u] = v,size[v] += size[u];
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp: At global scope:
bridges.cpp:36:34: error: template argument 1 is invalid
36 | int getroot(int node,vector <data> & record) {
| ^
bridges.cpp:36:34: error: template argument 2 is invalid
bridges.cpp:36:34: error: template argument 1 is invalid
bridges.cpp:36:34: error: template argument 2 is invalid
bridges.cpp:36:34: error: template argument 1 is invalid
bridges.cpp:36:34: error: template argument 2 is invalid
bridges.cpp:36:34: error: template argument 1 is invalid
bridges.cpp:36:34: error: template argument 2 is invalid
bridges.cpp:36:22: error: invalid template-id
36 | int getroot(int node,vector <data> & record) {
| ^~~~~~
bridges.cpp:36:30: error: reference to 'data' is ambiguous
36 | int getroot(int node,vector <data> & record) {
| ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
346 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
336 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
325 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
314 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
bridges.cpp:32:8: note: 'struct data'
32 | struct data {
| ^~~~
bridges.cpp:36:22: error: missing template argument list after 'std::vector'; template placeholder not permitted in parameter
36 | int getroot(int node,vector <data> & record) {
| ^~~~~~
| <>
bridges.cpp:36:22: note: or use 'auto' for an abbreviated function template
In file included from /usr/include/c++/13/vector:66,
from /usr/include/c++/13/functional:64,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53:
/usr/include/c++/13/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
bridges.cpp: In function 'int getroot(...)':
bridges.cpp:38:36: error: 'record' was not declared in this scope
38 | int d = getroot(root[node],record);
| ^~~~~~
bridges.cpp:39:43: error: reference to 'size' is ambiguous
39 | record.push_back({node,root[node],size[node],d,size[node]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:39:56: error: reference to 'size' is ambiguous
39 | record.push_back({node,root[node],size[node],d,size[node]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp: At global scope:
bridges.cpp:43:36: error: template argument 1 is invalid
43 | void union(int u,int v,vector <data> & record) {
| ^
bridges.cpp:43:36: error: template argument 2 is invalid
bridges.cpp:43:36: error: template argument 1 is invalid
bridges.cpp:43:36: error: template argument 2 is invalid
bridges.cpp:43:36: error: template argument 1 is invalid
bridges.cpp:43:36: error: template argument 2 is invalid
bridges.cpp:43:36: error: template argument 1 is invalid
bridges.cpp:43:36: error: template argument 2 is invalid
bridges.cpp:43:24: error: invalid template-id
43 | void union(int u,int v,vector <data> & record) {
| ^~~~~~
bridges.cpp:43:32: error: reference to 'data' is ambiguous
43 | void union(int u,int v,vector <data> & record) {
| ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
346 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
336 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
325 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
314 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
bridges.cpp:32:8: note: 'struct data'
32 | struct data {
| ^~~~
bridges.cpp:43:24: error: missing template argument list after 'std::vector'; template placeholder not permitted in parameter
43 | void union(int u,int v,vector <data> & record) {
| ^~~~~~
| <>
bridges.cpp:43:24: note: or use 'auto' for an abbreviated function template
/usr/include/c++/13/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
428 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
bridges.cpp: In function 'void __union__(...)':
bridges.cpp:44:23: error: 'record' was not declared in this scope
44 | u = getroot(u,record);
| ^~~~~~
bridges.cpp:48:37: error: reference to 'size' is ambiguous
48 | record.push_back({u,root[u],size[u],v,size[u]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:48:47: error: reference to 'size' is ambiguous
48 | record.push_back({u,root[u],size[u],v,size[u]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:51:37: error: reference to 'size' is ambiguous
51 | record.push_back({v,root[v],size[v],root[v],size[v] + size[u]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:51:53: error: reference to 'size' is ambiguous
51 | record.push_back({v,root[v],size[v],root[v],size[v] + size[u]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:51:63: error: reference to 'size' is ambiguous
51 | record.push_back({v,root[v],size[v],root[v],size[v] + size[u]});
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:52:9: error: reference to 'size' is ambiguous
52 | size[v] += size[u];
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:52:20: error: reference to 'size' is ambiguous
52 | size[v] += size[u];
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp: At global scope:
bridges.cpp:56:27: error: template argument 1 is invalid
56 | void rollback(vector <data> & record) {
| ^
bridges.cpp:56:27: error: template argument 2 is invalid
bridges.cpp:56:27: error: template argument 1 is invalid
bridges.cpp:56:27: error: template argument 2 is invalid
bridges.cpp:56:27: error: template argument 1 is invalid
bridges.cpp:56:27: error: template argument 2 is invalid
bridges.cpp:56:27: error: template argument 1 is invalid
bridges.cpp:56:27: error: template argument 2 is invalid
bridges.cpp:56:15: error: invalid template-id
56 | void rollback(vector <data> & record) {
| ^~~~~~
bridges.cpp:56:6: error: variable or field 'rollback' declared void
56 | void rollback(vector <data> & record) {
| ^~~~~~~~
bridges.cpp:56:29: error: missing template arguments before '&' token
56 | void rollback(vector <data> & record) {
| ^
bridges.cpp:56:31: error: 'record' was not declared in this scope
56 | void rollback(vector <data> & record) {
| ^~~~~~
bridges.cpp: In function 'int main()':
bridges.cpp:98:56: error: reference to 'size' is ambiguous
98 | for (int i = 1;i <= n;i++) root[i] = i,size[i] = 1;
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:112:37: error: template argument 1 is invalid
112 | vector <data> record;
| ^
bridges.cpp:112:37: error: template argument 2 is invalid
bridges.cpp:136:43: error: reference to 'size' is ambiguous
136 | answer[d.index] = size[getroot(island,record)];
| ^~~~
/usr/include/c++/13/bits/range_access.h:274:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
274 | size(const _Tp (&)[_Nm]) noexcept
| ^~~~
/usr/include/c++/13/bits/range_access.h:264:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
264 | size(const _Container& __cont) noexcept(noexcept(__cont.size()))
| ^~~~
bridges.cpp:21:18: note: 'int size [100009]'
21 | int root[100009],size[100009];
| ^~~~
bridges.cpp:138:25: error: 'rollback' was not declared in this scope
138 | rollback(record);
| ^~~~~~~~