Submission #494835

#TimeUsernameProblemLanguageResultExecution timeMemory
494835TeaTimeFriend (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#include "friend.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <tuple>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef long double ld;

#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

const ll SZ = 2e5 + 100;
ll dp[SZ][2], svd[SZ][2]; // 0 for dont take, 1 for take

int confidence[SZ], host[SZ], protocol[SZ];
int findSample(int n, int confidence[], int host[], int protocol[]) {
    for (int i = n - 1; i >= 0; i--) {
        dp[i][1] += confidence[i];
        dp[i][1] = max(dp[i][1], dp[i][0]);
        dp[i][1] = max(dp[i][1], svd[i][1]);

        if (i == 0) continue;

        if (protocol[i] == 0) {
            dp[host[i]][0] += dp[i][1];
            dp[host[i]][1] += dp[i][0];
        } else if (protocol[i] == 1) {
            dp[host[i]][0] += dp[i][0];
            dp[host[i]][1] += dp[i][1];
        } else {
            svd[host[i]][1] = max(svd[host[i]][1], dp[i][1]);
            dp[host[i]][0] += dp[i][0];
            dp[host[i]][1] += dp[i][0];
        }
    }

    return dp[0][1];
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccDigAo1.o:(.bss+0xc3540): multiple definition of `confidence'; /tmp/ccd193x0.o:(.bss+0x186d40): first defined here
/usr/bin/ld: /tmp/ccDigAo1.o:(.bss+0x0): multiple definition of `protocol'; /tmp/ccd193x0.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccDigAo1.o:(.bss+0x61aa0): multiple definition of `host'; /tmp/ccd193x0.o:(.bss+0xc36a0): first defined here
collect2: error: ld returned 1 exit status