QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#448946#8578. 과일 게임HuangHanShengCompile Error//C++201.7kb2024-06-20 14:04:372024-06-20 14:04:37

Details

answer.code:45:13: error: expected unqualified-id before ‘)’ token
   45 | struct node(){
      |             ^
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,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_vector.h: In instantiation of ‘static constexpr std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_S_max_size(const _Tp_alloc_type&) [with _Tp = node; _Alloc = std::allocator<node>; size_type = long unsigned int; _Tp_alloc_type = std::vector<node>::_Tp_alloc_type]’:
/usr/include/c++/13/bits/stl_vector.h:1906:23:   required from here
answer.code:60:19:   in ‘constexpr’ expansion of ‘t.std::vector<node>::vector(((std::vector<node>::size_type)(((long long int)N) * 4)), std::allocator<node>())’
/usr/include/c++/13/bits/stl_vector.h:554:32:   in ‘constexpr’ expansion of ‘std::vector<node>::_S_check_init_len(__n, (* & __a))’
/usr/include/c++/13/bits/stl_vector.h:1919:61: error: invalid application of ‘sizeof’ to incomplete type ‘node’
 1919 |           = __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
      |                                                             ^~~~~~~~~~~
In file included from /usr/include/c++/13/ext/alloc_traits.h:34,
                 from /usr/include/c++/13/bits/basic_string.h:39,
                 from /usr/include/c++/13/string:54,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52:
/usr/include/c++/13/bits/alloc_traits.h: In instantiation of ‘static constexpr std::allocator_traits<std::allocator<_CharT> >::size_type std::allocator_traits<std::allocator<_CharT> >::max_size(const allocator_type&) [with _Tp = node; size_type = long unsigned int; allocator_type = std::allocator<node>]’:
/usr/include/c++/13/bits/stl_vector.h:1920:51:   required from ‘static constexpr std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_S_max_size(const _Tp_alloc_type&) [with _Tp = node; _Alloc = std::allocator<node>; size_type = long unsigned int; _Tp_alloc_type = std::vector<node>::_Tp_alloc_type]’
/usr/include/c++/13/bits/stl_vector.h:1906:23:   required from here
/usr/include/c++/13/bits/alloc_traits.h:575:29: error: invalid application of ‘sizeof’ to incomplete type ‘std::allocator_traits<std::allocator<node> >::value_type’ {aka ‘node’}
  575 |         return size_t(-1) / sizeof(value_type);
      |                             ^~~~~~~~~~~~~~~~~~
answer.code: In function ‘void build(long long int, long long int, long long int)’:
answer.code:64:13: error: invalid use of incomplete type ‘__gnu_cxx::__alloc_traits<std::allocator<node>, node>::value_type’ {aka ‘struct node’}
   64 |         t[v].init(A[v]);
      |             ^
answer.code:45:8: note: forward declaration of ‘__gnu_cxx::__alloc_traits<std::allocator<node>, node>::value_type’ {aka ‘struct node’}
   45 | struct node(){
      |        ^~~~
answer.code:69:16: error: no match for ‘operator+’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<node>, node>::value_type’ {aka ‘node’} and ‘__gnu_cxx::__alloc_traits<std::allocator<node>, node>::value_type’ {aka ‘node’})
   69 |     t[v]=t[v*2]+t[v];
In file included from /usr/include/c++/13/bits/stl_algobase.h:67,
                 from /usr/include/c++/13/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/bits/stl_iterator.h:634:5: note: candidate: ‘template<class _Iterator> constexpr std::reverse_iterator<_IteratorL> std::operator+(typename reverse_iterator<_IteratorL>::difference_type, const reverse_iterator<_IteratorL>&)’
  634 |     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:634:5: note:   template argument deduction/substitution failed:
answer.code:69:20: note:   ‘__gnu_cxx::__alloc_traits<std::allocator<node>, node>::value_type’ {aka ‘node’} is not derived from ‘const std::reverse_iterator<_IteratorL>’
   69 |     t[v]=t[v*2]+t[v];
      |                    ^
/usr/include/c++/13/bits/stl_iterator.h:1808:5: note: candidate: ‘template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename move_iterator<_IteratorL>::difference_type, const move_iterator<_IteratorL>&)’
 1808 |     operator+(typename move_iterator<_Iterator>::difference_type __n,
      |     ^~~~~~~~
/usr/include/c++/13/bits/stl_iterator.h:1808:5: note:   template argument deduction/substitution failed:
answer.code:69:20: note:   ‘__gnu_cxx::__alloc_traits<std::allocator<node>, node>::value_type’ {aka ‘node’} is not derived from ‘const std::move_iterator<_IteratorL>’
   69 |     t[v]=t[v*2]+t[v];
      |                    ^
/usr/include/c++/13/bits/basic_string.h:3541:5: note: candidate: ‘template<class _CharT, class _Traits, class _Alloc> constexpr std::__cxx11::basic_string<_CharT...