Article From:https://www.cnblogs.com/MisakaAzusa/p/9216212.html

Title Link: https://www.luogu.org/problemnew/show/P2580

#include <map>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 100001;
map<string,int> a;
int n, m, num[maxn];
string s;
int main()
{
    memset(num,-1,sizeof(num));
    scanf("%d",&n);
    for(int i = 1; i <= n; i++)
    {
        cin>>s;
        a[s] = i;
        num[a[s]]++;
    }
    scanf("%d",&m);
    for(int i = 1; i <= m; i++)
    {
        cin>>s;
        if(num[a[s]] ==-1)
        {
            printf("WRONG\n");
            continue;//Remember continue, or you'll make a mistake if you repeat the wrong name.}Num[a[s]]++;If (num[a[s]] = = 1){Printf ("OK\n");}If (num[a[s]] > 1){Printf ("REPEAT\n");}}Return 0;}

Leave a Reply

Your email address will not be published. Required fields are marked *