제출 #1005698

#제출 시각아이디문제언어결과실행 시간메모리
1005698hasan2006Unscrambling a Messy Bug (IOI16_messy)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "messy.h"

using namespace std;

#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define se second
#define fi first
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"

int n , a[200];

void rec(int l , int r){
    if(r - l == 1)
        return;
    string a(n , '0');
    for(int i = l; i < r; i++)
        a[i] = '1';
    for(int i = l; i < (l + r) / 2; i++){
        a[i] = '0';
        add_element(a);
        a[i] = '1';
    }
    rec(l , (l + r) / 2);
    rec((l + r) / 2 , r);
}

void f(vector<int>v , int x){
    if(v.size() == 1){
        a[v[0]] = x;
        return;
    }
    string s(n , '0');
    vector<int>l , r;
    for(auto to : v)
        s[to] = '1';
    for(auto to : v){
        s[to] = '0';
        if(check_element(s))
            l.pb(to);
        else
            r.pb(to);
        s[to] = '1';
    }
    f(l , x);
    f(r , x | r.size());
}

vector<int> restore_permutation(int n, int w, int r) {
    vector<int>v , ans;
    int i;
    ::n = n;
    rec(0, n);
    compile_set();
    for(i = 0; i < n; i++)
        v.pb(i);
    f(v , 0);
    for(i = 0; i < n; i++)
        ans.pb(a[i]);
    return ans;
}


int main(){

}

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

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