Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created December 2, 2013 01:09
Show Gist options
  • Save pepet96/7743332 to your computer and use it in GitHub Desktop.
Save pepet96/7743332 to your computer and use it in GitHub Desktop.
Godzilla and Mecha-Godzilla (Short Version)
import static java.lang.Integer.*;
import static java.lang.Math.*;
import java.util.*;
import java.io.*;
public class godzillarmy {
public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for(int c = 0, C = parseInt(in.readLine().trim()); c++ < C;){
in.readLine();in.readLine();
int maxG = 0, maxM = 0;
for(StringTokenizer st = new StringTokenizer(in.readLine()); st.hasMoreTokens(); ) maxG = max(maxG, parseInt(st.nextToken()));
for(StringTokenizer st = new StringTokenizer(in.readLine()); st.hasMoreTokens(); ) maxM = max(maxM, parseInt(st.nextToken()));
System.out.println(maxG>=maxM?"Godzilla":"MechaGodzilla");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment