-
Notifications
You must be signed in to change notification settings - Fork 0
/
letsC.cpp
69 lines (66 loc) · 1.19 KB
/
letsC.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include<iostream>
#include<vector>
#include<stdio.h>
using namespace std;
bool isPrime(int n){
if(n==1){
return true;
}
else
{
for(int i=2;i*i<=n;i++){
if(n%i==0){
return false;
}
}
}
return true;
}
int main(){
vector<int> sv(10000,0);
int n;
cin>>n;
for(int i=0;i<n;i++){
int rankn;
cin>>rankn;
if(i==0){
sv[rankn]=1;
}
else if(isPrime(i+1)){
sv[rankn]=2;
}
else
{
sv[rankn]=3;
}
}
int qn;
cin>>qn;
for(int i=0;i<qn;i++){
int id;
cin>>id;
if(sv[id]==1){
printf("%04d: Mystery Award\n",id);
sv[id]=4;
}
else if (sv[id]==2)
{
printf("%04d: Minion\n" ,id);
sv[id]=4;
}
else if (sv[id]==3)
{
printf("%04d: Chocolate\n" ,id);
sv[id]=4;
}
else if (sv[id]==4)
{
printf("%04d: Checked\n" ,id);
sv[id]=4;
}
else
{
printf("%04d: Are you kidding?\n" ,id);
}
}
}