제출 #993712

#제출 시각아이디문제언어결과실행 시간메모리
993712firewater친구 (IOI14_friend)C++17
35 / 100
2 ms1372 KiB
#include "friend.h" #include<bits/stdc++.h> #define ll long long #define N 100100 using namespace std; // Find out best sample int x,f[N],g[N]; int findSample(int n,int confidence[],int host[],int protocol[]){ memset(f,0,sizeof(f)); memset(g,0,sizeof(g)); for(int i=0;i<n;++i) f[i]=confidence[i]; for(int i=n-1;i>0;--i){ x=host[i]; if(protocol[i]==0)f[x]+=g[i],g[x]+=max(f[i],g[i]); else if(protocol[i]==1)f[x]+=max(f[i],g[i]),g[x]+=g[i]; else f[x]=max(f[x]+g[i],g[x]+f[i]),g[x]+=g[i]; } return max(f[0],g[0]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...