Submission #975971

#TimeUsernameProblemLanguageResultExecution timeMemory
975971OrifkhonPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
// Source: https://usaco.guide/general/io #include <bits/stdc++.h> #include <perm.h> using namespace std; #define int long long vector<int> construct_permutation(long long k) { int size = log2(k); vector<int> perm(size); for(int i = 0; i < size; i++){ perm[i] = i; } k-=(1 << size); int insert = size + 1; while(true){ if(k == 0){ break; } int ind = log2(k); k-=(1 << ind); perm.insert(perm.begin() + ind, insert); insert++; } return perm; }

Compilation message (stderr)

perm.cpp:7:13: error: ambiguating new declaration of 'std::vector<long long int> construct_permutation(long long int)'
    7 | vector<int> construct_permutation(long long k) {
      |             ^~~~~~~~~~~~~~~~~~~~~
In file included from perm.cpp:4:
perm.h:3:18: note: old declaration 'std::vector<int> construct_permutation(long long int)'
    3 | std::vector<int> construct_permutation(long long k);
      |                  ^~~~~~~~~~~~~~~~~~~~~