# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
256547 | b00n0rp | Friend (IOI14_friend) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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];}