-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharmy.cpp
More file actions
34 lines (31 loc) · 698 Bytes
/
army.cpp
File metadata and controls
34 lines (31 loc) · 698 Bytes
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
#include <iostream>
#include <queue>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
// freopen("../output.txt", "w", stdout);
int g, mg, x, test_cases;
cin >> test_cases;
while (test_cases--) {
priority_queue <int> godzilla, mecha_godzilla;
cin >> g >> mg;
while (g--) {
cin >> x;
godzilla.push(x);
}
while (mg--) {
cin >> x;
mecha_godzilla.push(x);
}
while (!godzilla.empty() && !mecha_godzilla.empty()) {
if (godzilla.top() < mecha_godzilla.top())
godzilla.pop();
else mecha_godzilla.pop();
}
if (mecha_godzilla.empty())
cout << "Godzilla" << endl;
if (godzilla.empty())
cout << "MechaGodzilla" << endl;
}
return 0;
}