Submission #108980

#TimeUsernameProblemLanguageResultExecution timeMemory
108980dantoh000Friend (IOI14_friend)C++14
100 / 100
41 ms2680 KiB
#include "friend.h" #include <bits/stdc++.h> using namespace std; int findSample(int n, int confidence[], int host[], int protocol[]) { int free =0; for (int i = n-1; i >= 1; i--){ int v = host[i]; if (protocol[i] == 0){ free += confidence[i]; confidence[v]-=confidence[i]; confidence[v] = max(0,confidence[v]); } if (protocol[i] == 1){ confidence[v] += confidence[i]; } if (protocol[i] == 2){ confidence[v] =max(confidence[i],confidence[v]); } //printf("%d %d %d %d\n",i,v,p[v],q[v]); } return free+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...