Submission #542336

#TimeUsernameProblemLanguageResultExecution timeMemory
542336Sho10Friend (IOI14_friend)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho #include "friend.h" using ll=long long; using ld=long double; int const INF=1000000005; ll const LINF=1000000000000000005; ll const mod=1000000007; ld const PI=3.14159265359; #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #define f first #define s second #define pb push_back #define mp make_pair #define endl '\n' #define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; pair<int,int>dp[100005]; int findsample(int n,int confidence[],int host[],int protocol[]){ for(int i=0;i<n;i++) { dp[i]=mp(0,confidence[i]); } for(int i=n-1;i>=1;i--) { int par=host[i]; if(protocol[i]==0){ dp[par].f=dp[par].f+dp[i].s; dp[par].s=dp[par].s+dp[i].f; }else if(protocol[i]==1){ dp[par].f+=dp[i].f; dp[par].s+=dp[i].s; }else { dp[par].s=max(dp[par].f+dp[i].s,dp[par].s+dp[i].f); dp[par].f+=dp[i].f; dp[par].s=max(dp[par].s,dp[par].f); } } return dp[0].s; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc6Qa0wJ.o: in function `main':
grader.cpp:(.text.startup+0xdd): undefined reference to `findSample(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status