forked from mpfeifer1/Kattis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
armystrengtheasy.cpp
54 lines (45 loc) · 1000 Bytes
/
armystrengtheasy.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
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for(int i = 0; i < n; i++) {
vector<int> g;
vector<int> m;
int gSize;
int mSize;
cin >> gSize;
cin >> mSize;
for(int i = 0; i < gSize; i++) {
int temp;
cin >> temp;
g.push_back(temp);
}
for(int i = 0; i < mSize; i++) {
int temp;
cin >> temp;
m.push_back(temp);
}
sort(g.begin(), g.end());
sort(m.begin(), m.end());
int g1 = 0;
int m1 = 0;
while(g1 < gSize && m1 < mSize) {
if(g[g1] < m[m1]) {
g1++;
}
else {
m1++;
}
}
if(g1 == gSize) {
cout << "MechaGodzilla" << endl;
}
else {
cout << "Godzilla" << endl;
}
}
}