QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#59410#2543. Edges, Colors and MSTMaMengQiCompile Error//C++1.6kb2022-10-29 15:25:312022-10-29 15:25:34

Details

answer.code:11:12: error: template argument 1 is invalid
   11 | vector<data>e[N];
      |            ^
answer.code:11:12: error: template argument 2 is invalid
answer.code: In function ‘void build(int, int)’:
answer.code:16:34: error: request for member ‘size’ in ‘e[x]’, which is of non-class type ‘int’
   16 |         for (int i=0;i<(int)e[x].size();++i){
      |                                  ^~~~
answer.code:17:27: error: invalid types ‘int[int]’ for array subscript
   17 |                 int j=e[x][i].x;
      |                           ^
answer.code:19:38: error: invalid types ‘int[int]’ for array subscript
   19 |                 build(j,x),ef[j]=e[x][i].y,f[j][0]=x;
      |                                      ^
answer.code: In function ‘int main()’:
answer.code:62:39: error: request for member ‘push_back’ in ‘e[a[i].data::x]’, which is of non-class type ‘int’
   62 |                 if (a[i].z) e[a[i].x].push_back((data){a[i].y,i,0}),e[a[i].y].push_back((data){a[i].x,i,0});
      |                                       ^~~~~~~~~
answer.code:62:50: error: reference to ‘data’ is ambiguous
   62 |                 if (a[i].z) e[a[i].x].push_back((data){a[i].y,i,0}),e[a[i].y].push_back((data){a[i].x,i,0});
      |                                                  ^~~~
In file included from /usr/include/c++/11/string:54,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/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++/11/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++/11/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++/11/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()))
      |     ^~~~
answer.code:6:8: note:                 ‘struct data’
    6 | struct data{
      |        ^~~~
answer.code:62:79: error: request for member ‘push_back’ in ‘e[a[i].data::y]’, which is of non-class type ‘int’
   62 |                 if (a[i].z) e[a[i].x].push_back((data){a[i].y,i,0}),e[a[i].y].push_back((data){a[i].x,i,0});
      |                                                                               ^~~~~~~~~
answer.code:62:90: error: reference to ‘data’ is ambiguous
   62 |                 if (a[i].z) e[a[i].x].push_back((data){a[i].y,i,0}),e[a[i].y].push_back((data){a[i].x,i,0});
      |                                                                                          ^~~~
In file included from /usr/include/c++/11/string:54,
                 from /usr/include/c++/11/bits/locale_classes.h:40,
                 from /usr/include/c++/11/bits/ios_base.h:41,
                 from /usr/include/c++/11/ios:42,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/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++/11/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++/11/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++/11/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()))
      |     ^~~~
ans...