제출 #385882

#제출 시각아이디문제언어결과실행 시간메모리
385882ParsaAlizadeh친구 (IOI14_friend)C++17
16 / 100
2 ms512 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; int findSample(int n, int confidence[], int host[], int protocol[]){ vector<int> c(confidence, confidence + n); int ans = 0; for (int i = n - 1; i >= 1; i--) { if (protocol[i] == 0) { c[host[i]] -= c[i]; ans += c[i]; } if (protocol[i] == 1) { c[host[i]] += c[i]; } if (protocol[i] == 2) { c[host[i]] = max(c[host[i]], c[i]); } }; ans += (c[0] > 0 ? c[0] : 0); return 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...