# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
256547 | 2020-08-02T20:20:00 Z | b00n0rp | Friend (IOI14_friend) | C++17 | 0 ms | 0 KB |
#include "friend.h" #define m(a,b) a>b?a:b int a,findSample(int n,int c[],int h[],int p[]){while(--n)(!p[n])?a+=c[n],c[h[n]]=m(0,c[h[n]]-c[n]):(p[n]-2)?c[h[n]]+=c[n]:c[h[n]]=m(c[h[n]],c[n]);return a+c[0];}