제출 #73911

#제출 시각아이디문제언어결과실행 시간메모리
73911funcsr친구 (IOI14_friend)C++17
100 / 100
59 ms1672 KiB
#include "friend.h" #include <vector> #define rep(i, n) for (int i=0; i<(n); i++) #define pb push_back using namespace std; int findSample(int N, int A[], int host[], int protocol[]) { int cost = 0; for (int x=N-1; x>0; x--) { int p = host[x]; if (protocol[x] == 0) cost += A[x], A[p] = max(0, A[p]-A[x]); else if (protocol[x] == 1) A[p] += A[x]; else A[p] = max(A[p], A[x]); } return cost + A[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...