제출 #1024504

#제출 시각아이디문제언어결과실행 시간메모리
1024504vjudge1친구 (IOI14_friend)C++17
100 / 100
18 ms4188 KiB
#include "friend.h" #include<bits/stdc++.h> using namespace std; long long p[100100],q[100100]; int findSample(int n,int confidence[],int host[],int protocol[]){ for(int i=0;i<n;i++)p[i]=confidence[i]; for(int i=n;--i;){ int H=host[i]; if(!protocol[i])p[H]+=q[i], q[H]+=max(q[i],p[i]); else if(protocol[i]==1) p[H]=max({p[H]+p[i],p[H]+q[i],q[H]+p[i]}), q[H]+=q[i]; else p[H]=max(p[H]+q[i],p[i]+q[H]),q[H]+=q[i]; p[i]=q[i]=0; } return max(p[0],q[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...