제출 #1277150

#제출 시각아이디문제언어결과실행 시간메모리
1277150al95ireyiz순열 (APIO22_perm)C++20
컴파일 에러
0 ms0 KiB
#pragma GCC optimize("O3", "fast-math", "unroll-loops", "no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
#if !defined(ONLINE_JUDGE) and !defined(EVAL)
#include "template/debug.h"
#else
#define d(x...)
#endif
#define fr first
#define er erase
#define in insert
#define sc second
#define ll long long
#define pb push_back
#define vll vector<ll>
#define pll pair<ll,ll>
#define len(x) (ll) x.size()
#define all(x) x.begin(),x.end()
const ll INF = 1e9, INFL = 1e18;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll maxn = 1e6 + 5;

ll n, m, k = 0;

vll merge(vll a, vll b, ll off = 0){
    for(ll i = 0; i < len(b); i ++) a.pb(b[i] + off);
    return a;
}
vll f(ll x){
    if(x == 1){
        return {};
    }
    if(x == 2){
        return {0};
    }
    for(ll i : {2, 3, 5, 9, 10, 12}){
        if(x % i == 0 and x > i and x != i * i){
            vll a = f(i);
            vll b = f(x / i);
            return merge(a, b, len(a));
        }
    }
    vll a = f(x / 2);
    a = merge(a, {len(a)});
    if(x % 2 == 1) a = merge({len(a)}, a);
    return a;

}
vector<int> construct_permutation(ll k){
    auto v = f(k);
    vector<int>cv;
    for(auto i : v){
        cv.pb(i);
    }
    return cv;
}
void _() {
    ll q;
    cin >> q;
    auto v = construct_permutation(q);
    for(auto i : v) cout << i << ' ' ;
}
signed main() {
    ll tm = clock();
    cin.tie(0)->sync_with_stdio(0);
    ll t = 1;
    // cin >> t;
    for(ll tt = 1; tt <= t; tt ++) _();
    cerr << "\n\033[1;31mTime: \033[1;30m" \
        << (double)(clock()-tm)/1000000 << "\033[1;32m seconds\n";
}

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

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