제출 #1060949

#제출 시각아이디문제언어결과실행 시간메모리
1060949KasymK순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; #define ff first #define ss second #define all(v) v.begin(), v.end() #define ll long long #define pb push_back #define pii pair<int, int> #define wr puts("----------------") template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;} template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;} vector<int> construct_permutation(ll k){ if(k <= 90){ vector<int> A; for(int i = k-2; i >= 0; --i) A.pb(i); return A; } vector<int> A; int sm = 0, sm_ = 0; bool ok = false; vector<int> answer; for(int i = 60; i >= 0; --i){ if(ok){ A.pb(sm); sm++; if(k>>i&1){ sm_--; A.pb(sm_); } } if(k>>i&1) ok = true; } for(auto &i : A) answer.pb(i-sm_); return answer; } int main(){ vector<int> kk = construct_permutation(14); for(int i : kk) printf("%d ", i); puts(""); return 0; }

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

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