Codeforces 469A I Wanna Be the Guy(水题)

题目链接:Codeforces 469A I Wanna Be the Guy

题目大意:两个人进行闯关游戏,给定A和B能通过的关卡,问说两人一起是否可以通过所有的关卡。

解题思路:水题。

#include 
#include 
#include 

using namespace std;
const int maxn = 105;

int main () {
    int n, m, x, c[maxn];
    memset(c, 0, sizeof(c));
    scanf("%d", &n);

    for (int i = 0; i < 2; i++) {
        scanf("%d", &m);
        for (int j = 0; j < m; j++) {
            scanf("%d", &x);
            c[x]++;
        }
    }

    int flag = true;
    for (int i = 1; i <= n; i++)
        if (c[i] == 0) {
            flag = false;
            break;
        }
    printf("%s\n", flag ? "I become the guy." : "Oh, my keyboard!");
    return 0;
}

你可能感兴趣的:(GRADE:D,CF,非常简单的签到题)