제출 #760590

#제출 시각아이디문제언어결과실행 시간메모리
760590coding_snorlax순열 (APIO22_perm)C++17
컴파일 에러
0 ms0 KiB
#include "perm.h" #include<bits/stdc++.h> using namespace std; //Main function split it to #(2^k-1) vector<int> split(long long int k){ vector<int> ans; while(k){ //cout << k << " "; long long int a = (long long int)log2(k+1); ans.push_back(a); k -= (long long int) pow(2,a)-1; } return ans; } vector<int> construct_permutation(long long int k) { k-=1; vector<int> process = split(k); int Count = 0; for(int i:process){ Count+=i; } vector<int> s; for(int i:process){ for(int j=Count-i;j<Count;j++){ s.push_back(j); } Count-=i; } return s; } int main(){ //vector<int> answer = construct_permutation(3); //for(int i:answer) cout << i << " "; vector<int> answer = construct_permutation(1000);//split((long long int)1024*1024*1024*1024*1024*1024-1); for(int i:answer) cout << i << " "; }

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

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