QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#730863#9570. Binary Treeucup-team467#Compile Error//C++146.0kb2024-11-09 22:04:372024-11-09 22:04:38

Details

answer.code:100:24: error: ‘Opt’ has incomplete type
  100 | void Work(array<int,5> Opt){
      |           ~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/13/functional:53,
                 from answer.code:5:
/usr/include/c++/13/tuple:2005:45: note: declaration of ‘struct std::array<int, 5>’
 2005 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
answer.code: In function ‘void Work(std::array<int, 5>)’:
answer.code:101:15: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
  101 |         auto &[Rest,Type,MidNode,L,R]=Opt;
      |               ^
answer.code: At global scope:
answer.code:147:28: error: ‘Opt’ has incomplete type
  147 | void WriteOpt(array<int,5> Opt){
      |               ~~~~~~~~~~~~~^~~
/usr/include/c++/13/tuple:2005:45: note: declaration of ‘struct std::array<int, 5>’
 2005 |   template<typename _Tp, size_t _Nm> struct array;
      |                                             ^~~~~
answer.code: In function ‘void WriteOpt(std::array<int, 5>)’:
answer.code:148:15: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
  148 |         auto &[Rest,Type,MidNode,L,R]=Opt;
      |               ^
answer.code: At global scope:
answer.code:151:14: error: aggregate ‘std::array<int, 5> Opt’ has incomplete type and cannot be defined
  151 | array<int,5> Opt;
      |              ^~~
answer.code: In function ‘void Solve()’:
answer.code:175:46: error: aggregate ‘std::array<int, 5> NowOpt’ has incomplete type and cannot be defined
  175 |                                 array<int,5> NowOpt;
      |                                              ^~~~~~
answer.code:187:46: error: elements of array ‘std::array<int, 5> NowOpt [3]’ have incomplete type
  187 |                                 array<int,5> NowOpt[3];
      |                                              ^~~~~~
answer.code:187:46: error: storage size of ‘NowOpt’ isn’t known
answer.code:205:40: error: no matching function for call to ‘min(<brace-enclosed initializer list>)’
  205 |                                 Opt=min({Opt,NowOpt[0],NowOpt[1],NowOpt[2]});
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:60,
                 from answer.code:6:
/usr/include/c++/13/bits/stl_algobase.h:233:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)’
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
answer.code:205:40: note:   candidate expects 2 arguments, 1 provided
  205 |                                 Opt=min({Opt,NowOpt[0],NowOpt[1],NowOpt[2]});
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)’
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algobase.h:281:5: note:   template argument deduction/substitution failed:
answer.code:205:40: note:   candidate expects 3 arguments, 1 provided
  205 |                                 Opt=min({Opt,NowOpt[0],NowOpt[1],NowOpt[2]});
      |                                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61:
/usr/include/c++/13/bits/stl_algo.h:5775:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)’
 5775 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5775:5: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_algo.h:5785:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)’
 5785 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/13/bits/stl_algo.h:5785:5: note:   template argument deduction/substitution failed: