Submission #984746

#TimeUsernameProblemLanguageResultExecution timeMemory
984746Uultan12Permutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include <random> std::vector<int> construct_permutation(long long k) { std::vector<int> permutation(k); for (int i = 0; i < k; ++i) { permutation[i] = i; } std::is_permutation(permutation.begin(), permutation.end()); return permutation; }

Compilation message (stderr)

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:9:63: error: no matching function for call to 'is_permutation(std::vector<int>::iterator, std::vector<int>::iterator)'
    9 |     std::is_permutation(permutation.begin(), permutation.end());
      |                                                               ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/c++/10/random:38,
                 from perm.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:2047:5: note: candidate: 'template<class _ForwardIterator1, class _ForwardIterator2> bool std::is_permutation(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2)'
 2047 |     is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
      |     ^~~~~~~~~~~~~~
/usr/include/c++/10/bits/stl_algobase.h:2047:5: note:   template argument deduction/substitution failed:
perm.cpp:9:63: note:   candidate expects 3 arguments, 2 provided
    9 |     std::is_permutation(permutation.begin(), permutation.end());
      |                                                               ^