Submission #378289

#TimeUsernameProblemLanguageResultExecution timeMemory
378289Dan4Life친구 (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

#define int ll
#define pb push_back
#define pf push_front
#define mp make_pair
#define fir first
#define sec second
#define all(a) a.begin(), a.end()
#define r_all(a) a.rbegin(), a.rend()
#define fast_io ios_base::sync_with_stdio(false); cin.tie(0);

const int maxn = 1010;
const int MOD = 1e9+7; //1e9+9;
const int MOD2 = 998244353; //998244853;
const int INF = 2e9;
const ll LINF = 4e18;
int n, m, x, y, l, r, k, q;
map<int, int> M, N;
string s, ss;
set<int> S;

vector<int> adj[maxn];
int confidence[maxn], host[maxn], protocol[maxn];
int findSample(int n, int confidence[], int host[], int protocol[])
{
    for(int i = 1; i < n; i++)
    {
        int x = host[i];
        if(protocol[i]==0)
        {
            adj[x].pb(i),adj[i].pb(x);
        }
        else if(protocol[i]==1)
        {
            for(auto u : adj[i]){
                adj[u].pb(i),adj[i].pb(u);
            }
        }
        else
        {
            adj[x].pb(i),adj[i].pb(x);
            for(auto u : adj[i]){
                adj[u].pb(i),adj[i].pb(u);
            }
        }
    }
    int ans = 0ll;
    for(int i = 0; i < n; i++)
    {
        S.clear();
        for(int j = 0; j < n; j++) if(j!=i)S.insert(j);
        for(auto u : adj[i]) S.erase(u);
        for(auto u : S) ans = max(ans, confidence[i]+confidence[u]);
    }
    return ans;
}

Compilation message (stderr)

/tmp/ccjzC9U4.o:(.bss+0xc3540): multiple definition of `confidence'
/tmp/ccVopwMi.o:(.bss+0x3f40): first defined here
/tmp/ccjzC9U4.o:(.bss+0x0): multiple definition of `protocol'
/tmp/ccVopwMi.o:(.bss+0x0): first defined here
/tmp/ccjzC9U4.o:(.bss+0x61aa0): multiple definition of `host'
/tmp/ccVopwMi.o:(.bss+0x1fa0): first defined here
/tmp/ccjzC9U4.o: In function `main':
grader.cpp:(.text.startup+0xdd): undefined reference to `findSample(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status