제출 #968332

#제출 시각아이디문제언어결과실행 시간메모리
968332batsukh2006순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "perm.h" using namespace std; #define int long long #define ff first #define ss second vector<int> construct_permutation(long long k){ int x=0; bool ok=0; vector<int> v; for(int i=59; i>=0; i--){ if(k&(1ll<<i)){ vector<int> c; if(ok==0){ ok=1; for(int z=0; z<i; z++,x++){ c.push_back(x); } }else{ int s=0; vector<int> t; int need=(1ll<<i)+1; for(int z=59; z>=0; z--){ if(need&(1ll<<z)){ if(z==0){ t.push_back(x); x++; }else{ for(int l=0; l<z; l++,x++){ t.push_back(x); } } } } for(int j=t.size()-1; j>=0; j--){ c.push_back(t[j]); } } for(int j=c.size()-1; j>=0; j--){ v.push_back(c[j]); } } } reverse(v.begin(),v.end()); return v; }

컴파일 시 표준 에러 (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:2:
perm.h:3:18: note: old declaration 'std::vector<int> construct_permutation(long long int)'
    3 | std::vector<int> construct_permutation(long long k);
      |                  ^~~~~~~~~~~~~~~~~~~~~
perm.cpp: In function 'std::vector<long long int> construct_permutation(long long int)':
perm.cpp:20:12: warning: unused variable 's' [-Wunused-variable]
   20 |        int s=0;
      |            ^