제출 #982847

#제출 시각아이디문제언어결과실행 시간메모리
982847alo_54순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
//#include "perm.h" #include <bits/stdc++.h> using namespace std; std::vector<int> construct_permutation(long long k) { vector <int> resp; long long prev = (long long)1; int cont = 0; while (prev <= k) { cont++; prev *= (long long)2; } cont --; long long aux = (long long) pow((long long)2, (long long)cont); int c =(int)(cont)+1; //cout<<"cont: "<<cont<<endl; for (long long i = aux + (long long)1; i <= k; i ++) { resp.push_back((int)c); c++; } reverse(resp.begin(), resp.end()); //print(resp); for (int i = 0; i < cont; i++) { resp.push_back(i); } return resp; } int main() { int k; cin>>k; vector <int> r = construct_permutation((long long)k); for(auto i: r) { cout<<i<<" "; } cout<<endl; }

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/cc9Jmaa4.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccEQYDG6.o:perm.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status