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 <bits/stdc++.h>
#include "friend.h"
#define ad push_back
using namespace std;
int pat;
int findSample(int n,int sz[],int host[],int pr[])
{
for(int i = n - 1; i > 0; i--)
{
if(pr[i] == 0)
{
pat += sz[i];
sz[host[i]] = max(0, sz[host[i]] - sz[i]);
}
else if(pr[i] == 1)
sz[host[i]] += sz[i];
else
{
sz[host[i]] = max(0, sz[host[i]] - sz[i]);
sz[host[i]] += sz[i];
}
}
return pat + sz[0];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |