# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
404180 | wmrmr | Friend (IOI14_friend) | C++17 | 0 ms | 0 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.
{
int p = host[i];
if(protocol[i] != 1) adj[i][p] = adj[p][i] = 1;
if(protocol[i] != 0)
for(int j=0;j<i;j++)
adj[i][j] = adj[j][i] = adj[j][i] || adj[p][j];
}
int dbg = 0;
for(int cur = 0 ; cur < (1<<n) ; cur++)
{
bool valid = 1;
for(int i=0;i<n;i++) for(int j=i+1;j<n;j++)
{
if( (cur&(1<<i)) && (cur&(1<<j)) )
if(adj[i][j]) valid = 0;
}
int temp = 0;
for(int i=0;i<n;i++)
if(cur&(1<<i)) temp += confidence[i];
if(valid) ans = max(ans,temp), dbg = cur;
}
return ans;
}
if(pt2)
{
for(int i=0;i<n;i++) ans += confidence[i];
return ans;
}
if(pt3)
{
for(int i=0;i<n;i++) ans = max(ans,confidence[i]);
return ans;
}
return 0;
}