제출 #976086

#제출 시각아이디문제언어결과실행 시간메모리
976086rythm_of_knight순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> // #define int long long using namespace std; void fastio() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); } void solve() { int k, temp; cin >> k; k--; temp = k; vector <int> v; while (temp) { v.push_back(temp & 1); temp >>= 1; } int sz = v.size(); for (int i = 0; i < sz; i++) { while (i > 0 && v[i - 1] == 0 && v[i] > 0) { v[i - 1] += 2; v[i]--; i--; } } int cnt = -1; vector <int> ans; for (int i = 0; i < sz; i++) { vector <int> t; while (v[i]--) { t.push_back(++cnt); } reverse(t.begin(), t.end()); for (int &u : t) { ans.push_back(u); } } for (int &u : ans) cout << u << ' '; cout << '\n'; } signed main() { fastio(); int q; cin >> q; while (q--) { solve(); } }

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

/usr/bin/ld: /tmp/cc5wxdGv.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccENXpkw.o:perm.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc5wxdGv.o: in function `main':
grader.cpp:(.text.startup+0x240): undefined reference to `construct_permutation(long long)'
collect2: error: ld returned 1 exit status