-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcf_div3_c1.cpp
More file actions
59 lines (59 loc) · 1.22 KB
/
Copy pathcf_div3_c1.cpp
File metadata and controls
59 lines (59 loc) · 1.22 KB
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
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int num;
cin>>num;
for (int i = 0; i < num; i++)
{
int n;
cin>>n;
int count1=0,count2=0;
vector<int> Ajisai;
vector<int> Mai;
Ajisai.push_back(0);
Mai.push_back(0);
for (int i = 1; i <= n; i++)
{
int temp;
cin>>temp;
Ajisai.push_back(temp);
}
for (int i = 1; i <= n; i++)
{
int temp;
cin>>temp;
Mai.push_back(temp);
}
for (int i = 1; i <= n; i++)
{
if (i%2==0)
{
if ((Ajisai[i]==1&&Mai[i]==0)||(Ajisai[i]==0&&Mai[i]==1))
{
count2++;
}
}
else
{
if ((Ajisai[i]==1&&Mai[i]==0)||(Ajisai[i]==0&&Mai[i]==1))
{
count1++;
}
}
}
if (count1<count2)
{
cout<<"Mai"<<endl;
}
else if (count1>count2)
{
cout<<"Ajisai"<<endl;
}
else
{
cout<<"Tie"<<endl;
}
}
}