Algorithm
There is a game called "I Wanna Be the Guy", consisting of n levels. 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 only p levels of the game. And Little Y can pass only q levels 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?
The first line contains a single integer n (1 ≤ n ≤ 100).
The next line contains an integer p (0 ≤ p ≤ n) at first, then follows p distinct integers a1, 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 1 to n.
If they can pass all the levels, print "I become the guy.". If it's impossible, print "Oh, my keyboard!" (without the quotes).
4
3 1 2 3
2 2 4
I become the guy.
4
3 1 2 3
2 2 3
Oh, my keyboard!
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.
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <stdio.h>
#include <bitset7gt;
using namespace std;
bitset<101> bs;
int main() {
int n;
scanf("%d", &n);
int p, tmp;
scanf("%d", &p);
while(p--) {
scanf("%d", &tmp);
bs[tmp] = 1;
}
scanf("%d", &p);
while(p--) {
scanf("%d", &tmp);
bs[tmp] = 1;
}
for(int i = 1; i <= n; i++)
if(!bs[i]) {
puts("Oh, my keyboard!");
return 0;
}
puts("I become the guy.");
return 0;
}
Copy The Code &
Try With Live Editor
Input
3 1 2 3
2 2 4
Output
Demonstration
Codeforces Solution-I Wanna Be the Guy-Solution in C, C++, Java, Python