Submission #16200

#TimeUsernameProblemLanguageResultExecution timeMemory
16200CodingBugFriend (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...