코드포스 469A (codeforces 469A)

코드포스 469A (codeforces 469A) 문제 풀이 및 코드 (description and code)

목차

Problem - 469A - Codeforces

코드

import java.io.*;

public class CF469A {
    static int n, p, q;
    static String ins[];
    static boolean[] b = new boolean[101];
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        n = Integer.parseInt(br.readLine());
        ins = br.readLine().split(" ");
        p = Integer.parseInt(ins[0]);
        for (int i = 1; i <= p; i++) {
            b[Integer.parseInt(ins[i])] = true;
        }
        ins = br.readLine().split(" ");
        q = Integer.parseInt(ins[0]);
        for (int i = 1; i <= q; i++) {
            b[Integer.parseInt(ins[i])] = true;
        }
        boolean isGameClear = true;
        for (int i = 1; i <= n; i++) {
            if (!b[i]) isGameClear = false;
        }
        bw.write((isGameClear) ? "I become the guy.\n" : "Oh, my keyboard!\n");
        bw.flush();bw.close();
    }
}

설명

Copied to clipboard