Submission #238360

#TimeUsernameProblemLanguageResultExecution timeMemory
238360caoashFriend (IOI14_friend)C++14
0 / 100
5 ms384 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; #define ll long long #define pi pair<int, int> #define f first #define s second #define pb push_back int findSample(int n, int* confidence, int* host, int* protocol){ int host_v = confidence[n-1], mv = 0, ans = 0; for(int i = n-1; i; i--){ mv = confidence[host[i]]; if(protocol[i] == 0){ if(host_v > mv){ ans += host_v; mv = 0; } else{ ans += host_v; mv -= host_v; } } else if(protocol[i] == 1){ mv += host_v; } else{ mv = max(host_v, mv); } host_v = mv, mv = 0; } ans += host_v; 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...