Submission #147897

#TimeUsernameProblemLanguageResultExecution timeMemory
147897willi19Friend (IOI14_friend)C++14
35 / 100
3 ms504 KiB
#include <cstdio> #include <cassert> #define __MAXSIZE__ 100002 #include "friend.h" #include<bits/stdc++.h> using namespace std; set<int,greater<int> > s; int with[100100],without[100100]; int findSample(int n,int confidence[],int host[],int protocol[]){ for(int i=n-1;i>0;i--) { with[i]+=confidence[i]; if(protocol[i]==0) { without[host[i]]+=max(with[i],without[i]); with[host[i]]+=without[i]; } if(protocol[i]==1) with[host[i]]+=with[i]; if(protocol[i]==2) { confidence[host[i]]=max(confidence[i],confidence[host[i]]); without[host[i]]+=without[i]; } } return max(with[0]+confidence[0],without[0]); } using namespace std;
#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...