Submission #805363

#TimeUsernameProblemLanguageResultExecution timeMemory
805363someoneFriend (IOI14_friend)C++14
100 / 100
33 ms2644 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 42; int findSample(int n, int confidence[], int host[], int protocol[]){ int ans = 0; for(int i = n-1; i > 0; i--) { if(protocol[i] == 0) { ans += confidence[i]; confidence[host[i]] = max(confidence[host[i]] - confidence[i], 0); } else if(protocol[i] == 1) { confidence[host[i]] += confidence[i]; } else { confidence[host[i]] = max(confidence[host[i]], confidence[i]); } } return ans + confidence[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...