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 中,有许多可视化管理工具可供使用.以下是一些常见的 Git 可视化管理工具及其功能的详细介绍. GitHub Desktop: GitHub Desktop 是由 GitHub 官方推出的 ...
- Echarts图表基本参数设置说明
ECharts 是一款强大的数据可视化库,可以通过 JavaScript 构建交互式和动态的图表.在使用 ECharts 进行图表绘制时,我们可以通过设置各种参数来达到我们想要的效果.下面是对 ECh ...
- SpringBoot项目启动过程动态修改接口请求路径
背景 最近遇到一个技术需求,需要对其他多个已有的服务进行整合打包为一个整体的服务,项目启动过程发现一个问题,在controller层多个服务之间存在相同的RequestMapping接口请求路径,导致 ...
- 【scikit-learn基础】--『预处理』之 标准化
数据的预处理是数据分析,或者机器学习训练前的重要步骤.通过数据预处理,可以 提高数据质量,处理数据的缺失值.异常值和重复值等问题,增加数据的准确性和可靠性 整合不同数据,数据的来源和结构可能多种多样, ...
- 分布式文件系统HDFS简介
HDFS实现目标: 兼容廉价的硬件设备 支持大数据集 实现流数据读写 支持简单的文件模型 强大的跨平台兼容性 自身的局限性: 不适合低延迟的数据访问 无法高效储存大量小文件 ...
- C++学习笔记八:极限和数学运算<limits><cmath>
1) <limits>库: 1.1 源文档: https://en.cppreference.com/w/cpp/types/numeric_limits #include <lim ...
- linux环境下脚本部署项目出现nohup: redirecting stderr to stdout问题
解决办法: 把后面的 "&" 改成 "2>&1 &" 最终改为: nohup java -jar ${JAR_NAME} --lo ...
- 记录一个MySQL中order by 和 limit 连用导致分页查询不生效的坑
具体现象和这位同学的一致,具体的解决办法也是参考这位同学的做法 参考文章地址:https://www.cnblogs.com/yuluoxingkong/p/10681583.html
- 后端程序员必会的前端知识-03:Vue2
三. Vue 2 1. Vue 基础 1) 环境准备 安装脚手架 npm install -g @vue/cli -g 参数表示全局安装,这样在任意目录都可以使用 vue 脚本创建项目 创建项目 vu ...
- 【UniApp】-uni-app-CompositionAPI传递数据
前言 好,经过上个章节的介绍完毕之后,了解了一下 uni-app-传递数据 那么了解完了uni-app-传递数据之后,这篇文章来给大家介绍一下 uni-app-CompositionAPI传递数据 首 ...