-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path469A.cpp
51 lines (37 loc) · 1017 Bytes
/
469A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <bits/stdc++.h>
using namespace std;
int main() {
int max_lvl;
// Input max level
cin >> max_lvl;
int len, num;
list<int> littleX, littleY;
// Input littleX
cin >> len;
for (int i = 0; i < len; i++) {
cin >> num;
littleX.push_back(num);
}
// Input littleY
cin >> len;
for (int i = 0; i < len; i++) {
cin >> num;
littleY.push_back(num);
}
bool filled = true;
for (int i = 1; i <= max_lvl; i++) {
list<int>::iterator it = find(littleX.begin(), littleX.end(), i);
// Check if little x can beat the level
if (it == littleX.end()) {
it = find(littleY.begin(), littleY.end(), i);
// Check if little y can beat the level
if (it == littleY.end()) {
filled = false;
break;
}
}
}
// Print result
cout << (filled ? "I become the guy." : "Oh, my keyboard!") << endl;
return 0;
}