题目链接:http://codeforces.com/problemset/problem/469/A
题目大意:双人闯关游戏,给出总关卡n和没人能闯过的关,问他们能闯过多少关。
解题思路:略。
#include <iostream>
#include<cstring>
using namespace std;
const int maxn = 105;
int main(){
int n ,u[maxn],c = 0,p,x;
cin >> n;
memset(u , 0 , sizeof(u));
for(int i=0;i<2;++i){
cin >> p;
while(p--){
cin>>x;
if(!u[x]) c++;
u[x]=1;
}
}
c == n ? cout<<"I become the guy." : cout<<"Oh, my keyboard!";
cout << "\n";
return 0;
}
本文提供CodeForces平台上的469A题的解答思路及C++实现代码。该题涉及双人合作闯关游戏,通过记录不能通过的关卡来计算总共能通过多少关。

862

被折叠的 条评论
为什么被折叠?



