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)