双层枚举嫌疑犯与当日是星期几,统计真话与假话是否满足题意
注意 fake<=N&&fake+neutral>=N 即假话数量不大于N,假话加上没用的废话数量不小于N
(注意OJ上的数据存在问题:冒号后跟一个空格,CHARLES的话最后的句号‘.’应为半角,非全角)
可用样例输入:
3 1 5 MIKE CHARLES KATE MIKE: I am guilty. MIKE: Today is Sunday. CHARLES: MIKE is guilty. KATE: I am guilty. KATE: How are you??
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> Par; typedef pair<int,Par> Pr; int M,N,P,ans,f[25]; char s1[300],s2[300],s3[300]; string dayStr[7]={ "Monday" ,"Tuesday" ,"Wednesday" ,"Thursday" ,"Friday" ,"Saturday" ,"Sunday" }; vector<string> name; map<string,int> mp; Pr prd[105]; inline int readDigit(){ int x=0;char c=getchar(); while(!isdigit(c))c=getchar(); for(;isdigit(c);c=getchar())x=x*10+c-'0'; return x; } inline void readName(){ char c;int i=0; while((c=getchar())!=' ')s1[i++]=c; s1[i]='