제출 #1064110

#제출 시각아이디문제언어결과실행 시간메모리
1064110wood친구 (IOI14_friend)C++17
0 / 100
1 ms348 KiB
#include "friend.h" #include <bits/stdc++.h> #define pb push_back #define ll long long using namespace std; // Find out best sample void getdp(int i, vector<int> children[], int n, int dp[][2], int confidence[]){ dp[i][0] = confidence[i]; dp[i][1] = 0; if(children[i].empty()) return; for(int x : children[i]){ getdp(x,children,n,dp,confidence); dp[i][0]+=dp[x][1]; dp[i][1]+=dp[x][0]; } } int findSample(int n,int confidence[],int host[],int protocol[]){ int dp[n][2]; vector<int> children[n]; for(int i = 1; i<n; i++) children[host[i]].pb(i); getdp(0,children,n,dp,confidence); return max(dp[0][0],dp[0][1]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...