您的位置:首页 > 其它

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

2014-09-24 20:18 429 查看
题目链接:Codeforces 469A I Wanna Be the Guy

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

解题思路:水题。
#include <cstdio>
#include <cstring>
#include <algorithm>

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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: