forked from Vicfred/codeforces-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
i_wanna_be_the_guy_469A.rs
67 lines (49 loc) · 1.26 KB
/
i_wanna_be_the_guy_469A.rs
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// https://codeforces.com/problemset/problem/469/A
// implementation, simulation
use std::io;
fn main() {
let mut levels = [0; 101];
let mut n = String::new();
io::stdin()
.read_line(&mut n)
.unwrap();
let n: i64 = n.trim().parse().unwrap();
let mut alice = String::new();
io::stdin()
.read_line(&mut alice)
.unwrap();
let alice: String = alice.chars().skip(2).collect();
let alice: Vec<i64> =
alice
.split_whitespace()
.map(|x| x.parse().unwrap())
.collect();
for x in alice {
levels[x as usize] = 1;
}
let mut bob = String::new();
io::stdin()
.read_line(&mut bob)
.unwrap();
let bob: String = bob.chars().skip(2).collect();
let bob: Vec<i64> =
bob
.split_whitespace()
.map(|x| x.parse().unwrap())
.collect();
for x in bob {
levels[x as usize] = 1;
}
let mut flag = true;
for x in 1..n+1 {
if levels[x as usize] == 0 {
flag = false;
break;
}
}
if flag {
println!("I become the guy.");
} else {
println!("Oh, my keyboard!");
}
}