水题
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<cmath>
using namespace std;
map<string, int> all;
vector<bool> visited;
bool is_prime(int t)
{
if (t==2) return true;
if (t%2==0) return false;
for (int i = 3;i <= sqrt(t);i+=2)
if (t%i == 0) return false;
return true;
}
int main()
{
int N;
cin >> N;
for (int t = 1;t <= N;t++)
{
string te;
cin >> te;
all[te] = t;
}
cin >> N;
visited.assign(10000, false);
while (N--)
{
string te;
cin >> te;
if (all.find(te) == all.end()) cout << te<<": Are you kidding?" << endl;
else
{
if (visited[stoi(te)]) cout << te << ": Checked" << endl;
else
{
visited[stoi(te)] = true;
if (all[te] == 1) cout << te << ": Mystery Award" << endl;
else if (is_prime(all[te])) cout << te << ": Minion" << endl;
else cout << te << ": Chocolate" << endl;
}
}
}
}