-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1059_C_compettion.cpp
89 lines (84 loc) · 1.54 KB
/
1059_C_compettion.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include<iostream>
#include<map>
#include<vector>
using namespace std;
typedef struct peo
{
int a;
int b;
bool rep;
peo():rep(true){};
}Peo;
bool issushu(int i)
{
bool flag =true;
for(int j=2;j<i;j++)
{
if(i%j==0)
{
flag =false;
}
}
return flag;
}
int main()
{
int num;
cin>>num;
int tmp;
map<int,int> mappeople;
for(int i=0;i<num;i++)
{
cin>>tmp;
mappeople.insert(pair<int,int>(i,tmp));
}
int checknum;
cin>>checknum;
vector<Peo> det;
Peo tmppeo;
for(int i=0;i<checknum;i++)
{
cin>>tmp;
auto iter = mappeople.find(tmp);
if(iter == mappeople.end())
{
tmppeo.a=tmp;
tmppeo.b=1;
}
else if(iter->second==0)
{
cout<<tmp<<": "<<"Mystery Award";
}
else if(issushu(i+1))
{
cout<<tmp<<": "<<"OK";
}
}
for(int i=0;i<checknum;i++)
{
if(det[i].rep=false)
{
switch(det[i].b)
{
case 1:
cout<<det[i].a<<": "<<"Are you kidding?";
break;
case 2:
cout<<det[i].a<<": "<<"Mystery Award";
break;
case 3:
cout<<det[i].a<<": "<<"Minion";
case 4:
cout<<det[i].a<<": "<<"Chocolate";
}
}
else
{
cout<<det[i].a<<": "<<"Checked";
}
if(i!=checknum)
{
cout<<endl;
}
}
}