제출 #1068848

#제출 시각아이디문제언어결과실행 시간메모리
1068848kilikuma순열 (APIO22_perm)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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);
      |                  ^~~~~~~~~~~~~~~~~~~~~