제출 #237070

#제출 시각아이디문제언어결과실행 시간메모리
237070crossing0verFriend (IOI14_friend)C++17
100 / 100
37 ms2936 KiB
#include<bits/stdc++.h> #include "friend.h" using namespace std; const int MAXN = 1E5+5; int val[MAXN]; int findSample(int n,int confidence[],int host[],int protocol[]){ int ans = 0; for (int i =0; i < n; i++) val[i] = confidence[i]; for (int i = n; i > 0; i--) { int v = host[i]; int t = protocol[i]; if (t == 1) { val[v] += val[i]; } else if (t == 2) { val[v] = max(val[v],val[i]); } else { ans += val[i]; val[v] = max (0,val[v] - val[i]); } } return val[0] + ans; }
#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...