Sunday, May 1, 2016

Codeforces 469A - I Wanna Be the Guy

#include<bits/stdc++.h>
long long  lp[100],lq[100], total[100];
using namespace std;
int main()
{
    long long i,n, j,k,levelp,levelq,count=0;
    cin>>n;
    cin>>levelp;
    for(i=0; i<levelp; i++){
        cin>>lp[i];
        total[i]=lp[i];
    }
    cin>>levelq;
    for(k=0; k<levelq; k++){
        cin>>lq[k];
        total[i]=lq[k];
        i++;
    }
   sort(total,total+(levelp+levelq));
   for(i=0; i<(levelp+levelq); i++){
    if(total[i]==total[i-1])
        total[i]='\0';
   }
   for(i=1; i<=(levelp+levelq); i++){
    for(j=0; j<(levelp+levelq); j++){
        if(i==total[j])
            count++;
    }
   }
   if(count==n)
    cout<<"I become the guy.\n";
   else
    cout<<"Oh, my keyboard!\n";
   count=0;

    return 0;
}

No comments:

Post a Comment