Submission #313575

#TimeUsernameProblemLanguageResultExecution timeMemory
313575juggernautFriend (IOI14_friend)C++14
100 / 100
36 ms1420 KiB
#include"friend.h" #include<bits/stdc++.h> using namespace std; int findSample(int n,int c[],int h[],int p[]){ int ans=0,i; for(i=n-1;i>0;i--){ if(p[i]==0)ans+=c[i],c[h[i]]=max(0,c[h[i]]-c[i]); if(p[i]==1)c[h[i]]+=c[i]; if(p[i]==2)c[h[i]]=max(c[h[i]],c[i]); } return ans+c[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...