제출 #725017

#제출 시각아이디문제언어결과실행 시간메모리
725017hollwo_pelw순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include "perm.h" #include "grader.cpp" #include <bits/stdc++.h> using namespace std; vector<int> construct_permutation(long long k) { if (k == 1) return {}; if (k == 2) return {0}; if (k == 3) return {1, 0}; vector<int> bits; for (; k; k /= 4) bits.push_back(k % 4); bool have3 = 0; int used_for_3 = 0; vector<int> p; if (bits.back() == 1) { p = {}; } else if (bits.back() == 2) { p = {0}; } else { // == 3 have3 = 1; p.push_back(-1e9); p.push_back(-1e9-1); } bits.pop_back(); reverse(bits.begin(), bits.end()); for (int f : bits) { // cout << f << '\n'; if (f == 0) { p.push_back(p.size()); p.push_back(p.size()); } else if (f == 1) { p.push_back(p.size()); p.push_back(p.size()); p.insert(p.begin(), p.size()); } else if (f == 2) { p.push_back(p.size()); p.insert(p.begin(), p.size()); p.push_back(p.size()); } else { if (have3) { p.push_back(p.size()); p.push_back(p.size()); p.push_back(-- used_for_3); } else { p.push_back(p.size()); p.push_back(-1e9); p.push_back(p.size()); p.push_back(-1e9 - 1); have3 = 1; } } } for (int x : p) cout << x << ' '; auto q = p; sort(q.begin(), q.end()); for (int &v : p) v = lower_bound(q.begin(), q.end(), v) - q.begin(); return p; }

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

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