제출 #16252

#제출 시각아이디문제언어결과실행 시간메모리
16252atomzeno친구 (IOI14_friend)C++98
100 / 100
43 ms2644 KiB
#include "friend.h" #define MX 100001 int D[MX],cnt; // Find out best sample int findSample(int n,int confidence[],int host[],int protocol[]){ int i; for(i=n;i>=0;i--){D[i]=confidence[i];} for(i=n-1;i>=1;i--){ if(protocol[i]==0){ cnt+=D[i]; D[host[i]]-=D[i]; D[host[i]]=D[host[i]]>0?D[host[i]]:0; D[i]=0; } if(protocol[i]==1){ D[host[i]]+=D[i]; D[i]=0; } if(protocol[i]==2){ D[host[i]]=D[host[i]]>D[i]?D[host[i]]:D[i]; D[i]=0; } } return cnt+D[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...