제출 #7563

#제출 시각아이디문제언어결과실행 시간메모리
7563baneling100친구 (IOI14_friend)C++98
100 / 100
40 ms3040 KiB
#include "friend.h" int D[100000][2]; int MAX(int X, int Y) { if(X>Y) return X; return Y; } int findSample(int n, int confidence[], int host[], int protocol[]) { int i; for(i=0 ; i<n ; i++) D[i][0]=confidence[i]; for(i=n-1 ; i>=1 ; i--) { if(protocol[i]==0) { D[host[i]][0]+=D[i][1]; D[host[i]][1]+=MAX(D[i][0],D[i][1]); } else if(protocol[i]==1) { D[host[i]][0]=MAX(D[host[i]][0]+MAX(D[i][0],D[i][1]),D[host[i]][1]+D[i][0]); D[host[i]][1]+=D[i][1]; } else { D[host[i]][0]=MAX(D[host[i]][0]+D[i][1],D[host[i]][1]+D[i][0]); D[host[i]][1]+=D[i][1]; } } return MAX(D[0][0],D[0][1]); }
#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...