CodeForces - 469A I Wanna Be the Guy
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 a 1, a 2, ..., a p (1 ≤ a i ≤ 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!
#include<bits/stdc++.h>
using namespace std;
int n, _size, input; set<int>ans;
int main() {
cin >> n; for (int i = 2; i--;)for (cin >> _size; _size--;)cin >> input, ans.insert(input);
cout << (n == ans.size() ? "I become the guy.\n" : "Oh, my keyboard!\n");
}
CodeForces - 469A I Wanna Be the Guy的更多相关文章
- Codeforces I Wanna Be the Guy 题解
这道题非常简单,有两种做法: 1. 用一个数组标记是不是每个关卡小X或小Y都可以通过 2. 用set储存小X和小Y能够通过的关卡(set有去重功能),最后判断set的长度是否等于n 因为楼上已经有第一 ...
- Codeforces Round #467 (Div. 2) B. Vile Grasshoppers
2018-03-03 http://codeforces.com/problemset/problem/937/B B. Vile Grasshoppers time limit per test 1 ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
- CodeForces - 696B Puzzles
http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
随机推荐
- Git 安装与配置教程
一.下载Git 1.官网地址 下载地址 2.下载 二.安装 1.下载完成后,直接点击安装包安装,即可. 2.开始安装,然后下一步 3.可以在此处自定义地址,然后下一步 3.选择组件 此处默认即可,但我 ...
- Navicat远程连接Centos8.4服务器MySQL8.0数据库
一.首先登陆服务器后台管理,使服务器开放3306策略 二.开启远程连接 1.登陆服务器的MySQL数据库 mysql -uroot -p 2.登录成功后,切换数据库 use mysql; 3.查看当前 ...
- 使用funcgraph-retval和bpftrace/kprobe快速定位并解决cpu控制器无法使能的问题
版本 Linux 6.5 背景 在学习cgroupv2的时候,想给子cgroup开启cpu控制器结果失败了: # 查看可以开启哪些控制器 root@ubuntu-vm:/sys/fs/cgroup# ...
- vertx的学习总结2
一.什么是verticle verticle是vertx的基本单元,其作用就是封装用于处理事件的技术功能单元 (如果不能理解,到后面的实战就可以理解了) 二.写一个verticle 1. 引入依赖( ...
- [ARC161F] Everywhere is Sparser than Whole (Judge)
Problem Statement We define the density of a non-empty simple undirected graph as $\displaystyle\fra ...
- style绑定及随机颜色
一个小案例 颜色变换 style单机事件的绑定
- IDEA创建MyBatis项目--实现简单的查操作
IDEA创建MyBatis项目--实现简单的查操作 1.创建一个maven工程,不使用模板 2.通过maven加载Mybatis依赖包 在pom文件中导入maven坐标 <dependencie ...
- python异步编程之asyncio初识
async await介绍 用asyncio提供的@asyncio.coroutine可以把一个生成器标记为协程类型,然后在协程内部用yield from 等待IO操作,让出cpu执行权. 然而异步的 ...
- vulnhub - Aragog - writeup
信息收集 目标开放了80.22端口. root@Lockly temp/tmp » arp-scan -I eth1 -l Interface: eth1, type: EN10MB, MAC: 00 ...
- Socket.D 替代 Http 协议像 Ajax 一样开发前端接口
我们在"前端接口"开发时,使用 socket.d 协议有什么好处: 功能上可以替代 http 和原生 ws 更安全!现有的工具想抓包数据,难!难!难!(socket.d 是个新的二 ...