zoukankan      html  css  js  c++  java
  • CodeForces

    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.
    " : "Oh, my keyboard!
    ");
    }
    
  • 相关阅读:
    Vue监视数据的原理
    JS 获取随机数
    Vue中的计算属性(computed)、方法(methods)、watch(侦听)
    Vue3中使用调试工具 Vue.js Devtools
    Vue3.X 新特性 Composition Api
    vue、js 保留小数点位数以及转化为百分比
    常用的网页布局之列表页
    CSS常见布局技巧
    2、C#入门第2课
    1、C#入门第一课
  • 原文地址:https://www.cnblogs.com/RioTian/p/13199965.html
Copyright © 2011-2022 走看看