Submission #48997

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
489972018-05-21 06:26:54NamnamseoFriend (IOI14_friend)C++17
35 / 100
3 ms1592 KiB
#include "friend.h"
// Find out best sample
int sum[100001][2];
int max(int a,int b){ return a>b?a:b; }
int min(int a,int b){ return a<b?a:b; }
bool edge[11][11];
int naive(int n,int cf[],int hst[],int pt[]){
for(int i=1; i<n; ++i){
int h=hst[i];
if(pt[i] == 0){
edge[h][i]=edge[i][h]=true;
} else {
for(int j=0; j<n; ++j) if(edge[h][j]) edge[j][i]=edge[i][j]=true;
if(pt[i] == 2){
edge[h][i]=edge[i][h]=true;
}
}
}
int msk=(1<<n);
int ans=0;
for(int i=0; i<msk; ++i){
int s[11], t=0;
int cur=0;
for(int j=0; j<n; ++j) if(1&(i>>j)) s[t++]=j, cur+=cf[j];
bool wa=0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...