#include<bits/stdc++.h>
using namespace std;
struct node{
int id;
int rank;
}p[10001];
bool isPrime(int n){
if (n < 2){
return false;
}
for (int i = 2; i < sqrt(n) + 1; i++){
if (n % i == 0){
return false;
}
}
return true;
}
int main(){
int n, k;
cin >> n;
for(int i = 0; i < n; i++){
cin >> p[i].id;
p[i].rank = i + 1;
}
cin >> k;
int temp;
int cnt[10001] = {0};
for (int i = 0; i < k; i++){
cin >> temp;
int num = 0;
for (int j = 0; j < n; j++){
if (temp == p[j].id){
if (cnt[temp] != 0){
printf("%04d: Checked\n", temp);
}
else if (j == 0 && cnt[temp] == 0){
printf("%04d: Mystery Award\n", temp);
cnt[temp]++;
}
else if (isPrime(p[j].rank) && cnt[temp] == 0){
printf("%04d: Minion\n", temp);
cnt[temp]++;
}
else{
printf("%04d: Chocolate\n", temp);
cnt[temp]++;
}
}
else if (temp != p[j].id){
num++;
if (num == n){
printf("%04d: Are you kidding?\n", temp);
}
}
}
}
return 0;
}
PAT/1059 C语言竞赛
最新推荐文章于 2024-07-08 22:12:26 发布