QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#458263#7942. $K$ SubsequencesHuangHanShengCompile Error//C++98593b2024-06-29 16:28:572024-06-29 16:28:58

詳細信息

answer.code: In function ‘int main()’:
answer.code:12:33: error: ‘>>’ should be ‘> >’ within a nested template argument list
   12 |                 set<pair<int,int>> s;
      |                                 ^~
      |                                 > >
answer.code:14:34: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   14 |                         s.insert({0,i+1});
      |                                  ^
answer.code:14:33: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   14 |                         s.insert({0,i+1});
      |                         ~~~~~~~~^~~~~~~~~
answer.code:21:38: error: ‘k’ does not name a type
   21 |                                 auto k=*s.begin();
      |                                      ^
answer.code:23:35: error: request for member ‘first’ in ‘k’, which is of non-class type ‘long long int’
   23 |                                 k.first++;
      |                                   ^~~~~
answer.code:24:41: error: no matching function for call to ‘std::set<std::pair<int, int> >::insert(long long int&)’
   24 |                                 s.insert(k);
      |                                 ~~~~~~~~^~~
In file included from /usr/include/c++/13/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:158,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_set.h:568:9: note: candidate: ‘template<class _InputIterator> void std::set<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]’
  568 |         insert(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~
/usr/include/c++/13/bits/stl_set.h:568:9: note:   template argument deduction/substitution failed:
answer.code:24:41: note:   candidate expects 2 arguments, 1 provided
   24 |                                 s.insert(k);
      |                                 ~~~~~~~~^~~
/usr/include/c++/13/bits/stl_set.h:511:7: note: candidate: ‘std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator, bool> std::set<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; typename std::_Rb_tree<_Key, _Key, std::_Identity<_Tp>, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other>::const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key>::other = std::allocator<std::pair<int, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<_Key> = __gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::rebind<std::pair<int, int> >; typename _Alloc::value_type = std::pair<int, int>; value_type = std::pair<int, int>]’
  511 |       insert(const value_type& __x)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_set.h:511:32: note:   no known conversion for argument 1 from ‘long long int’ to ‘const std::set<std::pair<int, int> >::value_type&’ {aka ‘const std::pair<int, int>&’}
  511 |       insert(const value_type& __x)
      |              ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_set.h:548:7: note: candidate: ‘std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = std::pair<int, int>; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >; iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; const_iterator = std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator; value_type = std::pair<int, int>]’
  548 |       insert(const_iterator __position, const value_type& __x)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_set.h:548:7: note:   candidate expects 2 arguments, 1 provided
answer.code:25:41: error: request for member ‘second’ in ‘k’, which is of non-class type ‘long long int’
   25 |                                 cout<<k.second<<" ";
      |                                         ^~~~~~
answer.code:29:38: error: ‘k’ does not name a type
   29 |                                 auto k=*--s.end();
      |                                      ^
answer.code:31:35: error: request for member ‘first’ in ‘k’, which is of non-class type ‘long long int’
   31 |                        ...