제출 #16200

#제출 시각아이디문제언어결과실행 시간메모리
16200CodingBug친구 (IOI14_friend)C++98
100 / 100
35 ms2256 KiB
#include "friend.h" #include <algorithm> using namespace std; // Find out best sample int findSample(int n,int cf[],int h[],int pc[]){ int i,c=0; for(i=n-1;i>0;i--){ if(pc[i]==0){ c+=cf[i]; cf[h[i]]=max(cf[h[i]]-cf[i],0); }else if(pc[i]==1) cf[h[i]]+=cf[i]; else cf[h[i]]=max(cf[h[i]],cf[i]); } return c+cf[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...