QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212743#4186. Card TradingMaMengQiCompile Error//C++981.0kb2023-10-13 20:15:282023-10-13 20:15:28

詳細信息

answer.code: In function ‘int main()’:
answer.code:11:21: error: ‘nullptr’ was not declared in this scope
   11 |             cin.tie(nullptr);
      |                     ^~~~~~~
answer.code:22:13: warning: lambda expressions only available with ‘-std=c++11’ or ‘-std=gnu++11’
   22 |             });
      |             ^
answer.code:20:17: error: no matching function for call to ‘sort(std::vector<node>::iterator, std::vector<node>::iterator, main()::<lambda(node, node)>)’
   20 |             sort(a.begin(), a.end(), [](node x, node y) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   21 |                 return x.value < y.value;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
   22 |             });
      |             ~~   
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_algo.h:4832:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
 4832 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/11/bits/stl_algo.h:4832:5: note:   template argument deduction/substitution failed:
answer.code:20:17: note:   candidate expects 2 arguments, 3 provided
   20 |             sort(a.begin(), a.end(), [](node x, node y) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   21 |                 return x.value < y.value;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
   22 |             });
      |             ~~   
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_algo.h:4863:5: note: candidate: ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
 4863 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/11/bits/stl_algo.h:4863:5: note:   template argument deduction/substitution failed:
answer.code: In substitution of ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator<node*, std::vector<node> >; _Compare = main()::<lambda(node, node)>]’:
answer.code:20:10:   required from here
answer.code:20:17: error: template argument for ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’ uses local type ‘main()::<lambda(node, node)>’
   20 |             sort(a.begin(), a.end(), [](node x, node y) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   21 |                 return x.value < y.value;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
   22 |             });
      |             ~~   
answer.code:20:17: error:   trying to instantiate ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’