Submission #499728

#TimeUsernameProblemLanguageResultExecution timeMemory
499728sidonFriend (IOI14_friend)C++17
100 / 100
27 ms1496 KiB
#include "friend.h" int findSample(int n, int c[], int h[], int p[]) { for(int i = (p[0]=0)+n; --i; ) { if(c[i] < 0) c[i] = 0; if(p[i] == 0) c[h[i]] -= c[i], p[0] += c[i]; if(p[i] == 1) c[h[i]] = c[i] + (c[h[i]] > 0 ? c[h[i]] : 0); if(p[i] == 2 && c[i] > c[h[i]]) c[h[i]] = c[i]; } return (c[0] > 0 ? c[0] : 0) + p[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...