如果发现广告等破坏行为,请尽量将条目恢复到较早的版本而不是把相应内容直接删除,谢谢合作。

URAL/1350

来自"NOCOW"

跳转到: 导航, 搜索

随便写就能A吧。。。

#include <iostream>
#include <string>
#include <set>
using namespace std;
int n,m,k,x,tot[101]={0};
string s;
set<string> t;
int main()
{
    scanf("%d%*c",&n);
    for (int i=1;i<=n;++i)  cin >> s;
    scanf("%d%d%*c",&k,&x);
    for (n-=x;x;--x)
    {
        cin >> s;
        t.insert(s);
    }
    for (int i=1;i<=k;++i)
        for (scanf("%d%*c",&x);x;--x)
        {
            cin >> s;
            if (t.find(s) == t.end())
                ++tot[i];
        }
    scanf("%d",&m);
    for (int i=1;i<=k;++i)
        if ((!tot[i]) || (!m))  printf("YES\n");
        else if (tot[i] > n-m)  printf("NO\n");
        else  printf("MAYBE\n");
    return 0;
}
//by zzy
个人工具