Codeforces I Wanna Be the Guy


题目链接:http://codeforces.com/problemset/problem/469/A




import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class I_Wanna_Be_the_Guy {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		Map map = new HashMap<>();
		
		int p = scanner.nextInt();
		for(int i = 0; i < p; i++) {
			int temp = scanner.nextInt();
			if(!map.isEmpty() && map.containsKey(temp)) {
				continue;
			}
			map.put(scanner.nextInt(), 1);
		}
		
		int q = scanner.nextInt();
		for(int i = 0; i< q; i++) {
			int temp = scanner.nextInt();
			if(!map.isEmpty() && map.containsKey(temp)) {
				continue;
			}
			map.put(temp, 1);
		}
		int size = map.size();
		if(size >= n) {
			System.out.println("I become the guy.");
		} else {
			System.out.println("Oh, my keyboard!");
		}
	}
}


你可能感兴趣的:(Codeforces)