이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "friend.h"
#include <algorithm>
using namespace std;
int findSample(int n,int c[],int h[],int p[]){
int a[n]={0};
while (--n){
if (p[n]){
c[h[n]]=max(max(c[h[n]]+a[n],c[n]+a[h[n]]),(p[n]>1?0:c[h[n]]+c[n]));
a[h[n]]+=a[n];
continue;
}
c[h[n]]+=a[n];
a[h[n]]+=max(c[n],a[n]);
}
return max(c[0],a[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... |