-
Notifications
You must be signed in to change notification settings - Fork 22
/
army.java
37 lines (34 loc) · 1.08 KB
/
army.java
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
import java.io.*;
import java.util.*;
import static java.lang.Integer.parseInt;
public class army
{
private static BufferedReader f;
public static void main(String[] args) throws IOException {
f = new BufferedReader(new InputStreamReader(System.in));
int t = parseInt(f.readLine());
int max, a; boolean godzilla;
StringTokenizer st;
while(t-->0)
{
f.readLine(); f.readLine();
godzilla = true; max = 0;
st = new StringTokenizer(f.readLine());
while(st.hasMoreTokens())
{
a = parseInt(st.nextToken());
if(a > max) max = a;
}
st = new StringTokenizer(f.readLine());
while(st.hasMoreTokens())
{
a = parseInt(st.nextToken());
if(a > max){ max = a; godzilla = false;}
}
if(godzilla) System.out.println("Godzilla");
else System.out.println("MechaGodzilla");
System.out.flush();
}
System.exit(0);
}
}