http://codeforces.com/problemset/problem/469/A I Wanna Be the Guy

记录已解决的问题数即可,注意不重复计数。

#include 
#include 
#include 
#include 
#define MAX 105
#define INF 0x3f3f3f3f
using namespace std;
bool a[MAX];
int main() {
    freopen("a.txt", "r", stdin);
    freopen("b.txt", "w", stdout);
    int n, p, x, c = 0;
    cin >> n;
    cin >> p;
    for (int i = 1; i <= p; ++i) {
        cin >> x;
        if (!a[x]) {
            a[x] = true;
            c++;
        }
    }
    cin >> p;
    for (int i = 1; i <= p; ++i) {
        cin >> x;
        if (!a[x]) {
            a[x] = true;
            c++;
        }
    }
    if (c == n) cout << "I become the guy." << endl;
    else cout << "Oh, my keyboard!" << endl;
    return 0;
}

你可能感兴趣的:(http://codeforces.com/problemset/problem/469/A I Wanna Be the Guy)