Codeforces 469a. I wanna be the guy (Mathematics)

Source: Internet
Author: User

Link: http://codeforces.com/contest/469/problem/A


A. I wanna be the guytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

There is a game called "I wanna be the guy", consistingNLevels. Little X and his friend Little y are addicted to the game. Each of them wants to pass the whole game.

Little X can pass onlyPLevels of the game. And little y can pass onlyQLevels of the game. you are given the indices of levels little X can pass and the indices of levels little y can pass. will little X and little y pass the whole game, if they cooperate each other?

Input

The first line contains a single integerN(1? ≤ ??N? ≤? 100 ).

The next line contains an integerP(0? ≤?P? ≤?N) At first, then followsPDistinct integersA1 ,?A2 ,?...,?AP(1? ≤?AI? ≤?N). These integers denote the indices of levels little X can pass. The next line contains the levels little y can pass in the same format. It's assumed that levels are numbered from 1N.

Output

If they can pass all the levels, print "I become the guy.". If it's impossible, print "oh, my keyboard! "(Without the quotes ).

Sample test (s) Input
43 1 2 32 2 4
Output
I become the guy.
Input
43 1 2 32 2 3
Output
Oh, my keyboard!
Note

In the first sample, little X can pass levels [1 2 3], and little y can pass level [2 4], so they can pass all the levels both.

In the second sample, no one can pass level 4.



The Code is as follows:

#include <cstdio>#include <cstring>int main(){    int n;    int vis[1117];    while(~scanf("%d",&n))    {        int x, y;        memset(vis,0,sizeof(vis));        int tt;        scanf("%d",&x);        for(int i = 0; i < x; i++)        {            scanf("%d",&tt);            vis[tt] = 1;        }        scanf("%d",&y);        for(int i = 0; i < y; i++)        {            scanf("%d",&tt);            vis[tt] = 1;        }        int flag = 0;        for(int i = 1; i <= n; i++)        {            if(vis[i] == 0)            {                flag = 1;                break;            }        }        if(flag)        {            printf("Oh, my keyboard!\n");        }        else            printf("I become the guy.\n");    }    return 0;}


Codeforces 469a. I wanna be the guy (Mathematics)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.