-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy path133A.cpp
More file actions
41 lines (31 loc) · 878 Bytes
/
133A.cpp
File metadata and controls
41 lines (31 loc) · 878 Bytes
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
/*
~ Author : @tridib_2003
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.1415926535897932384626
#define MOD 1000000007
#define vi vector<int>
#define mk(arr, n, type) type *arr = new type[n];
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define w(x) int x; cin >> x; while(x--)
#define FIO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int main() {
FIO;
string p;
cin >> p;
unordered_set<char> instructions;
instructions.insert('H');
instructions.insert('Q');
instructions.insert('9');
for (int i = 0; p[i]; ++i) {
auto itr = instructions.find(p[i]);
if (itr != instructions.end()) {
cout << "YES";
return 0;
}
}
cout << "NO";
return 0;
}