제출 #586043

#제출 시각아이디문제언어결과실행 시간메모리
586043krit3379친구 (IOI14_friend)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include"friend.h" using namespace std; #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define N 100005 int sum,ans; bool f[3]; int findSample(int n,int confidence[N],int host[N],int protocol[N]){ int i,j,k; if(n<=10){ bitset<15> vis[N]; for(i=0;i<=n;i++)vis[i]=0; for(i=1;i<n;i++){ if(protocol[i])for(j=0;j<n;j++)if(vis[host[i]][j])vis[i][j]=vis[j][i]=true; if(protocol[i]!=1)vis[i][host[i]]=vis[host[i]][i]=true; } for(i=0;i<(1<<n);i++){ sum=0; for(j=0;j<n;j++){ if(i&(1<<j)){ for(k=0;k<n;k++)if(vis[j][k]&&(i&(1<<k)))break; if(k!=n)break; sum+=confidence[j]; } } if(j==n)ans=max(ans,sum); } } else if(n<=1000){ for(i=1;i<n;i++)f[protocol[i]]=true; if(protocal[1]==0)for(i=0;i<n;i++)ans+=confidence[i]; else if(protocal[1]==1)for(i=0;i<n;i++)ans=max(ans,confidence[i]); else if(!f[0]&&!f[1]&&f[2])ans=0; } else{ } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:34:12: error: 'protocal' was not declared in this scope; did you mean 'protocol'?
   34 |         if(protocal[1]==0)for(i=0;i<n;i++)ans+=confidence[i];
      |            ^~~~~~~~
      |            protocol