博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
A - I Wanna Be the Guy
阅读量:5235 次
发布时间:2019-06-14

本文共 1769 字,大约阅读时间需要 5 分钟。

Problem description

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?

Input

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.

Output

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

Examples

Input

4 3 1 2 3 2 2 4

Output

I become the guy.

Input

4 3 1 2 3 2 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.

解题思路:标记一下1~n出现的数字,如果都出现了,则输出"I become the guy.",否则输出"Oh, my keyboard!",水过!

AC代码:

1 #include
2 using namespace std; 3 int main(){ 4 int n,p,q,x;bool flag=false,used[105]; 5 memset(used,false,sizeof(used)); 6 cin>>n>>p; 7 for(int i=1;i<=p;++i){cin>>x;used[x]=true;} 8 cin>>q; 9 for(int i=1;i<=q;++i){cin>>x;used[x]=true;}10 for(int i=1;i<=n;++i)11 if(!used[i]){flag=true;break;}12 if(flag)cout<<"Oh, my keyboard!"<

 

转载于:https://www.cnblogs.com/acgoto/p/9159193.html

你可能感兴趣的文章
{面试题7: 使用两个队列实现一个栈}
查看>>
【练习】使用事务和锁定语句
查看>>
centos7升级firefox的flash插件
查看>>
Apache Common-IO 使用
查看>>
评价意见整合
查看>>
二、create-react-app自定义配置
查看>>
Android PullToRefreshExpandableListView的点击事件
查看>>
系统的横向结构(AOP)
查看>>
linux常用命令
查看>>
NHibernate.3.0.Cookbook第四章第6节的翻译
查看>>
使用shared memory 计算矩阵乘法 (其实并没有加速多少)
查看>>
Django 相关
查看>>
git init
查看>>
训练记录
查看>>
IList和DataSet性能差别 转自 http://blog.csdn.net/ilovemsdn/article/details/2954335
查看>>
Hive教程(1)
查看>>
第16周总结
查看>>
C#编程时应注意的性能处理
查看>>
Fragment
查看>>
比较安全的获取站点更目录
查看>>