제출 #313567

#제출 시각아이디문제언어결과실행 시간메모리
313567talant117408친구 (IOI14_friend)C++17
컴파일 에러
0 ms0 KiB
#include "friend.h"
#include "grader.cpp"
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair <ll, ll> pii;
 
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define eps (double)1e-9
#define PI 2*acos(0.0)
#define endl "\n"
#define sz(v) (int)(v).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int findSample(int n, int conf[], int host[], int prot[]){
    
    int p[n], q[n];
    for(int i = 0; i < n; i++){
        p[i] = conf[i];
        q[i] = 0;
    }
    
    for(int i = n-1; i; i--){
        int ph = p[host[i]], qh = q[host[i]], pr = p[i], qr = q[i];
        if(!prot[i]){
            p[host[i]] = ph+qr;
            q[host[i]] = max(pr+qh, qh+qr);
        }
        else if(prot[i]&1){
            p[host[i]] = max(ph+qr, max(pr+qh, ph+pr));
            q[host[i]] = qh+qr;
        }
        else{
            p[host[i]] = max(ph+qr, pr+qh);
            q[host[i]] = qh+qr;
        }
    }
    
    return max(p[0], q[0]);     
}

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

/tmp/ccbbWx0R.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccxyfXTJ.o:friend.cpp:(.text.startup+0x0): first defined here
/tmp/ccbbWx0R.o:(.bss+0xc3540): multiple definition of `confidence'
/tmp/ccxyfXTJ.o:(.bss+0xc3540): first defined here
/tmp/ccbbWx0R.o:(.bss+0x0): multiple definition of `protocol'
/tmp/ccxyfXTJ.o:(.bss+0x0): first defined here
/tmp/ccbbWx0R.o:(.bss+0x61aa0): multiple definition of `host'
/tmp/ccxyfXTJ.o:(.bss+0x61aa0): first defined here
collect2: error: ld returned 1 exit status