#include "friend.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> p[1001];
int ans[1001][2];
inline void go(int v){
for(auto x : p[v]){
go(x);
ans[v][0] += max(ans[x][1], ans[x][0]);
ans[v][1] += ans[x][0];
}
}
int findSample(int n,int confidence[],int host[],int protocol[]){
ans[0][1] = confidence[0];
for(int i = 1; i < n; i++){
p[host[i]].push_back(i);
ans[i][1] = confidence[i];
}
go(0);
return max(ans[0][0], ans[0][0]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Incorrect |
2 ms |
468 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
468 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Incorrect |
3 ms |
644 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |