제출 #302542

#제출 시각아이디문제언어결과실행 시간메모리
302542kevinsogo친구 (IOI14_friend)C++17
100 / 100
34 ms3072 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; int findSample(int n, int conf[], int host[], int prot[]) { vector<int> omit(n); for (int i = n; --i;) { int j = host[i]; conf[j] += prot[i] == 1 ? conf[i] : max(omit[i], omit[j] + conf[i] - conf[j]); omit[j] += prot[i] == 0 ? conf[i] : omit[i]; conf[j] = max(conf[j], omit[j]); } return conf[0]; }
#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...