Submission #1068848

#TimeUsernameProblemLanguageResultExecution timeMemory
1068848kilikumaPermutation (APIO22_perm)C++17
Compilation error
0 ms0 KiB
#include "perm.h" #include <bits/stdc++.h> using namespace std; #define int long long vector<int> construct_permutation(int k) { vector<int> ans; k --; vector<int> puis(61, 1); for (int i = 1; i < 61; i ++) { puis[i] = puis[i - 1] * 2; } int cur = -1; for (int i = 60; i >= 1; i --) { while (puis[i] - 1 <= k) { for (int j = cur + i; j >= cur + 1; j --) { ans.push_back(j); } cur += i; k -= (puis[i] - 1); } } reverse(ans.begin(), ans.end()); return ans; }

Compilation message (stderr)

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