제출 #313639

#제출 시각아이디문제언어결과실행 시간메모리
313639tengiz05친구 (IOI14_friend)C++17
100 / 100
39 ms2424 KiB
#include "friend.h" #include <algorithm> int findSample(int n,int c[],int h[],int p[]){ int ans=0,i; for(i=n;--i;){ if(p[i]==0)ans+=c[i],c[h[i]]=std::max(0,c[h[i]]-c[i]); if(p[i]==1)c[h[i]]+=c[i]; if(p[i]==2)c[h[i]]=std::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...