Submission #984750

#TimeUsernameProblemLanguageResultExecution timeMemory
984750Uultan12Permutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include <vector> #include <algorithm> std::vector<int> construct_permutation(int64_t k) { int n = 1; while ((n * (n + 1)) / 2 < k) { ++n; } std::vector<int> permutation(n); for (int i = 0; i < k; ++i) { permutation[i] = i; } // Fill the remaining elements with values not used in the increasing subsequence int next_value = k; for (int i = k; i < n; ++i) { permutation[i] = next_value++; } return permutation; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccmSganN.o: in function `main':
grader.cpp:(.text.startup+0x240): undefined reference to `construct_permutation(long long)'
collect2: error: ld returned 1 exit status