//头
```
#include<iostream>
using namespace std;
int murderer,sum,lie;
int who_day[105],text_name_long[300],who[300][300],who_name,who_textmoney[300];
char name[100][300],textmoney[100][300];
bool book[100];
int N,M,P;
int have_name(int t){
for(int j=1;j<=M;j++)
for(int i=text_name_long[t];i<=250;i++){
if(textmoney[t][i]==' '&&name[j][i]==' ')return j;
if(textmoney[t][i]!=name[j][i])break;
}
return 0;
}
```
by Ousmane_Dembele @ 2018-04-09 21:53:01
```
void check(int t){
for(int i=1;i<=250;i++)
if(textmoney[t][i]==':')text_name_long[t]=i-1;
//cout<<text_name_long[t]<<endl;
for(int j=1;j<=M;j++)
for(int i=1;i<=text_name_long[t];i++){
if(i==text_name_long[t])who_textmoney[t]=j;//cout<<i<<endl;//
if(textmoney[t][i]!=name[j][i])break;
}
easy(t);
}
int main(){
cin>>N>>M>>P;
for(int i=1;i<=M;i++)
cin>>name[i]+1;
for(int i=1;i<=P;i++){
gets(textmoney[i]+1);
check(i);
}
bool flag;
for(int i=1;i<=M;i++){
flag=true;
lie=0;
for(int j=1;j<=M;j++){
if(who[j][i]==3)
if(book[j]==2||book[j]==0)
book[j]=2;
else break;
else if(who[j][i]==1)
if(book[j]==1||book[j]==0){
book[j]=1;
lie++;
}
else break;
}
if(lie>N)break;
for(int j=1;j<=M&&flag;j++){
if(book[j]==2)
for(int k=1;k<=M;k++)
if(who[j][k]==3&&k!=i){
flag=false;
break;
}
else if(book[j]==1)
for(int k=1;k<=M;k++)
if(who[j][k]==1&&k!=i) {
flag=false;
break;
}
}
flag=true;
for(int j=1;j<=7&&flag;j++){
for(int k=1;k<=M&&flag;k++){
if(who_day[k]==j)
if(book[k]==2||book[k]==0)
book[k]=2;
else{flag=false; break;}
if(who_day[k]!=j&&who_day[k]!=0)
if(book[k]==1||book[k]==0){
book[k]=1;
lie++;
if(lie>N)
flag=false;
}
else{flag=false; break;}
}
}
if(lie==N){
sum++;
if(sum>=2)break;
murderer=i;
}
}
if(sum==0)
cout<<"Impossible";
if(sum==1)
cout<<name[murderer];
if(sum>=2)
cout<<"Cannot Determine";
return 0;
}//后面
```
by Ousmane_Dembele @ 2018-04-09 21:53:43
除了头文件问题
by Ousmane_Dembele @ 2018-04-09 21:55:30