# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48997 | Namnamseo | Friend (IOI14_friend) | C++17 | 3 ms | 1592 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |