Submission #140306

#TimeUsernameProblemLanguageResultExecution timeMemory
140306ggohFriend (IOI14_friend)C++14
27 / 100
37 ms2680 KiB
#include "friend.h" #include<bits/stdc++.h> // Find out best sample int up(int p) { if(p>0)return p;else return 0; } int findSample(int n,int confidence[],int host[],int protocol[]){ int ans=0; int i; for(i=n-1;i>0;i--) { if(protocol[i]==0) { confidence[host[i]]-=confidence[i]; ans+=confidence[i]; } else if(protocol[i]==1) { confidence[host[i]]=up(confidence[host[i]])+up(confidence[i]); } else if(protocol[i]==2) { confidence[host[i]]=std::max(up(confidence[host[i]]),up(confidence[i])); } } return ans+up(confidence[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...