제출 #982839

#제출 시각아이디문제언어결과실행 시간메모리
982839vjudge1순열 (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 pot = 0, prev = 1; while (prev <= k) { pot = prev; prev *= 2; } long long diff = k - pot; for (long long i =(long long) (pot + diff) ; i > pot; i--) { resp.push_back(i); } for (int i = 0; i <= pot; 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/cciG3nkE.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccT9RjGG.o:perm.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status