Submission #494843

#TimeUsernameProblemLanguageResultExecution timeMemory
494843TeaTimeFriend (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#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]; for (int i = n - 1; i >= 0; i--) { dp[i][1] = max(dp[i][1], dp[i][0]); if (i == 0) continue; if (protocol[i] == 0) { dp[host[i]][0] += dp[i][1]; dp[host[i]][1] += dp[i][0]; dp[host[i]][1] = max(dp[host[i]][1], dp[host[i]][0]); } else if (protocol[i] == 1) { dp[host[i]][0] += dp[i][0]; dp[host[i]][1] += max(dp[i][0], dp[i][1]); dp[host[i]][1] = max(dp[host[i]][1], dp[host[i]][0] + dp[i][1]); dp[host[i]][1] = max(dp[host[i]][1], dp[host[i]][0]); } 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/ccWemv87.o:(.bss+0xc3540): multiple definition of `confidence'; /tmp/ccXgmFA9.o:(.bss+0x186d40): first defined here
/usr/bin/ld: /tmp/ccWemv87.o:(.bss+0x0): multiple definition of `protocol'; /tmp/ccXgmFA9.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccWemv87.o:(.bss+0x61aa0): multiple definition of `host'; /tmp/ccXgmFA9.o:(.bss+0xc36a0): first defined here
collect2: error: ld returned 1 exit status