Submission #984744

# Submission time Handle Problem Language Result Execution time Memory
984744 2024-05-17T04:25:27 Z Uultan12 Permutation (APIO22_perm) C++17
Compilation error
0 ms 0 KB
#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::shuffle(permutation.begin(), permutation.end(), std::mt19937(std::random_device()()));
    return permutation;
}

Compilation message

perm.cpp: In function 'std::vector<int> construct_permutation(long long int)':
perm.cpp:8:10: error: 'shuffle' is not a member of 'std'
    8 |     std::shuffle(permutation.begin(), permutation.end(), std::mt19937(std::random_device()()));
      |          ^~~~~~~