QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#344194#7933. Build PermutationGuanYunchangCompile Error//C++98786b2024-03-03 18:14:012024-03-03 18:14:01

Details

answer.code: In function ‘int main()’:
answer.code:20:65: warning: lambda expressions only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   20 |     sort(b + 1, b + n + 1, [&](int x, int y){return a[x] < a[y];});
      |                                                                 ^
answer.code:20:9: error: no matching function for call to ‘sort(int*, int*, main()::<lambda(int, int)>)’
   20 |     sort(b + 1, b + n + 1, [&](int x, int y){return a[x] < a[y];});
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_algo.h:4851:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
 4851 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/13/bits/stl_algo.h:4851:5: note:   template argument deduction/substitution failed:
answer.code:20:9: note:   candidate expects 2 arguments, 3 provided
   20 |     sort(b + 1, b + n + 1, [&](int x, int y){return a[x] < a[y];});
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:4882:5: note: candidate: ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
 4882 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/13/bits/stl_algo.h:4882: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 = int*; _Compare = main()::<lambda(int, int)>]’:
answer.code:20:9:   required from here
answer.code:20:9: error: template argument for ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’ uses local type ‘main()::<lambda(int, int)>’
   20 |     sort(b + 1, b + n + 1, [&](int x, int y){return a[x] < a[y];});
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:20:9: error:   trying to instantiate ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
answer.code:21:59: warning: lambda expressions only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   21 |     sort(a + 1, a + n + 1, [&](int x, int y){return x < y;});
      |                                                           ^
answer.code:21:9: error: no matching function for call to ‘sort(ll*, ll*, main()::<lambda(int, int)>)’
   21 |     sort(a + 1, a + n + 1, [&](int x, int y){return x < y;});
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:4851:5: note: candidate: ‘template<class _RAIter> void std::sort(_RAIter, _RAIter)’
 4851 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/13/bits/stl_algo.h:4851:5: note:   template argument deduction/substitution failed:
answer.code:21:9: note:   candidate expects 2 arguments, 3 provided
   21 |     sort(a + 1, a + n + 1, [&](int x, int y){return x < y;});
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algo.h:4882:5: note: candidate: ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
 4882 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/13/bits/stl_algo.h:4882: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 = long long int*; _Compare = main()::<lambda(int, int)>]’:
answer.code:21:9:   required from here
answer.code:21:9: error: template argument for ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’ uses local type ‘main()::<lambda(int, int)>’
   21 |     sort(a + 1, a + n + 1, [&](int x, int y){return x < y;});
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
answer.code:21:9: error:   trying to instantiate ‘template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)’
answer.code:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
answer.code:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |         scanf("%lld", &a[i]);
      |         ~~~~~^~~~~~~~~~~~~~~