Submission #1066664

#TimeUsernameProblemLanguageResultExecution timeMemory
1066664SoMotThanhXuanSwapping Cities (APIO20_swap)C++17
Compilation error
0 ms0 KiB
#include <swap.h> #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define MASK(i) (1LL << (i)) #define BIT(x, i) (((x) >> (i)) & 1) #define FOR(i, a, b) for(int i = a; i <= b; ++i) #define FORD(i, a, b) for(int i = b; i >= a; --i) #define REP(i, a, b) for(int i = a; i < b; ++i) #define REPD(i, a, b) for(int i = b; i > a; -- i) #define ALL(v) v.begin(),v.end() #define next __next #define left __left #define right __right #define prev __prev const int MOD[6] = {(int)1e9 + 7, (int)1e9 + 2277, (int)1e9 + 5277, (int)1e9 + 8277, (int)1e9 + 9277, 998244353}; const int BASE[6] = {23309, 300, 330, 280, 2309, 256}; const int base = BASE[0]; const int mod = MOD[0]; void add(int &u, int v){ u += v; if(u >= mod) u -= mod; } void sub(int &u, int v){ u -= v; if(u < 0) u += mod; } void minimize(int &u, int v){ if(u > v) u = v; } void maximize(int &u, int v){ if(u < v) u = v; } void minimizell(long long &u, long long v){ if(u > v) u = v; } void maximizell(long long &u, long long v){ if(u < v) u = v; } const int maxN = 3e5 + 2; const int maxM = 3e5 + 2; const int maxK = 1e2 + 2; const int INF = 1e9 + 8; const long long INFLL = 1e18; const int LOG = 16; vector<pair<int, int>> adj[maxN]; int next[maxN]; bool cycle[maxN]; pair<int, pair<int, int>> edge[maxM]; int n; int root[maxN], high[maxN]; int par[LOG + 1][maxN], Max[LOG + 1][maxN], child[maxN]; int find_root(int v){ return root[v] = root[v] == v ? v : find_root(root[v]); } void dfs(int u, int p){ for(pair<int, int> x : adj[u]){ int v = x.first; int w = x.second; if(v == p)continue; high[v] = high[u] + 1; // cout << u << ' ' << v << "\n"; dfs(v, u); ++child[u]; par[0][v] = u; Max[0][v] = w; } } void dfs2(int u, int p){ if(p){ if(child[p] == 1){ next[u] = Max[0][u]; }else next[u] = next[p]; } for(pair<int, int> x : adj[u]){ int v = x.first; if(v != p)dfs2(v, u); } } void dfs3(int u, int p){ for(pair<int, int> x : adj[u]){ int v = x.first; if(v != p){ dfs3(v, u); cycle[u] |= cycle[v]; } } } void sparse_table(){ } void addEdge(int u, int v, int w){ ++n; u = find_root(u); v = find_root(v); root[n] = n; root[u] = root[v] = n; adj[n].push_back({u, w}); // cout << n << ' ' << u << ' ' << v << "\n"; if(u != v)adj[n].push_back({v, w}); } void init(int N, int M, vector<int> U, vector<int> V[], vector<int> W[]){ REP(i, 0, M){ edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}}; } sort(edge + 1, edge + 1 + M); n = N; FOR(i, 1, M)addEdge(edge[i].se.fi, edge[i].se.se, edge[i].fi); dfs(n, 0); high[0] = -1; FOR(i, 1, N)root[i] = i; FOR(j, 1, LOG)FOR(i, 1, n){ par[j][i] = par[j - 1][par[j - 1][i]]; Max[j][i] = max(Max[j - 1][i], Max[j - 1][par[j - 1][i]]); } dfs2(n, 0); // FOR(i, 1, n)cout << child[i] << ' ';cout << "\n"; FOR(i, N + 1, n)if(child[i] == 1)cycle[i] = true; dfs3(n, 0); // FOR(i, 1, n)cout << next[i] << ' ';cout << "\n"; // FOR(i, 1, n)cout << cycle[i] << ' ';cout << "\n"; } int getMinimumFuelCapacity(int u, int v){ int res = 0; if(high[u] < high[v]) swap(u, v); FORD(i, 0, LOG)if(high[par[i][u]] >= high[v])maximize(res, Max[i][u]),u = par[i][u]; if(u == v){ if(cycle[u]) return res; return next[u] == 0 ? -1 : next[u]; } FORD(i, 0, LOG)if(par[i][u] != par[i][v]){ maximize(res, Max[i][u]); maximize(res, Max[i][v]); u = par[i][u]; v = par[i][v]; } maximize(res, Max[0][u]); maximize(res, Max[0][v]); u = par[0][u]; if(cycle[u]){ return res; } else return next[u] == 0 ? - 1 : next[u]; }

Compilation message (stderr)

swap.cpp: In function 'void init(int, int, std::vector<int>, std::vector<int>*, std::vector<int>*)':
swap.cpp:106:46: error: no match for 'operator+' (operand types are 'std::vector<int>' and 'int')
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                         ~~~~ ^ ~
      |                                            |   |
      |                                            |   int
      |                                            std::vector<int>
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
                 from /usr/include/c++/10/vector:60,
                 from swap.h:1,
                 from swap.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:508:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)'
  508 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:508:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:67,
                 from /usr/include/c++/10/vector:60,
                 from swap.h:1,
                 from swap.cpp:1:
/usr/include/c++/10/bits/stl_iterator.h:1540:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)'
 1540 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/10/bits/stl_iterator.h:1540:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6022:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 6022 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6022:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:56,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.tcc:1160:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 1160 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.tcc:1160:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   mismatched types 'const _CharT*' and 'std::vector<int>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:56,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.tcc:1180:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 1180 |     operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.tcc:1180:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6059:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
 6059 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6059:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6075:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
 6075 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6075:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6087:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 6087 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6087:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6093:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 6093 |     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6093:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6099:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 6099 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6099:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6121:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 6121 |     operator+(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6121:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   mismatched types 'const _CharT*' and 'std::vector<int>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6127:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)'
 6127 |     operator+(_CharT __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6127:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6133:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)'
 6133 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6133:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/string:55,
                 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 swap.cpp:2:
/usr/include/c++/10/bits/basic_string.h:6139:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)'
 6139 |     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
      |     ^~~~~~~~
/usr/include/c++/10/bits/basic_string.h:6139:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from swap.cpp:2:
/usr/include/c++/10/complex:331:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&, const std::complex<_Tp>&)'
  331 |     operator+(const complex<_Tp>& __x, const complex<_Tp>& __y)
      |     ^~~~~~~~
/usr/include/c++/10/complex:331:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'const std::complex<_Tp>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from swap.cpp:2:
/usr/include/c++/10/complex:340:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator+(const std::complex<_Tp>&, const _Tp&)'
  340 |     operator+(const complex<_Tp>& __x, const _Tp& __y)
      |     ^~~~~~~~
/usr/include/c++/10/complex:340:5: note:   template argument deduction/substitution failed:
swap.cpp:106:48: note:   'std::vector<int>' is not derived from 'const std::complex<_Tp>'
  106 |         edge[i + 1] = {W[i], {U[i] + 1, V[i] + 1}};
      |                                                ^
In file included from /usr/include/c++/10/ccom