Submission #227963

#TimeUsernameProblemLanguageResultExecution timeMemory
227963urd05친구 (IOI14_friend)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; int n; int co[100000]; int host[100000]; int pro[100000]; int con[10][10]; int findSample(int nn,int conf[],int hos[],int prot[]) { n=nn; for(int i=0;i<n;i++) { co[i]=conf[i]; host[i]=hos[i]; pro[i]=prot[i]; } for(int i=1;i<n;i++) { if (pro[i]==0) { con[host[i]][i]=1; con[i][host[i]]=1; } if (pro[i]==1) { for(int j=0;j<n;j++) { if (con[host[i]][j]==1) { con[i][j]=1; con[j][i]=1; } } } if (pro[i]==2) { for(int j=0;j<n;j++) { if (con[host[i]][j]==1) { con[i][j]=1; con[j][i]=1; } } con[host[i]][i]=1; con[i][host[i]]=1; } } int ret=0; for(int i=0;i<(1<<n);i++) { bool use[10]; memset(use,0,sizeof(use)); for(int j=0;j<n;j++) { if ((i&(1<<j))!=0) { use[j]=true; } } bool flag=true; for(int j=0;j<n;j++) { for(int k=0;k<n;k++) { if (con[k][j]==1&&use[k]&&use[j]) { flag=false; break; } } } if (!flag) { continue; } int val=0; for(int j=0;j<n;j++) { if (use[j]) { val+=co[j]; } } ret=max(ret,val); } return ret; }

Compilation message (stderr)

/tmp/ccZgCprq.o:(.bss+0x61aa0): multiple definition of `host'
/tmp/ccPLoHTh.o:(.bss+0x61c20): first defined here
/usr/bin/ld: Warning: size of symbol `host' changed from 400000 in /tmp/ccPLoHTh.o to 400008 in /tmp/ccZgCprq.o
collect2: error: ld returned 1 exit status