-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
44 lines (40 loc) · 1.04 KB
/
Copy pathA.cpp
File metadata and controls
44 lines (40 loc) · 1.04 KB
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
#include <bits/stdc++.h>
using namespace std;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define sep ' '
#define debug(x) cerr << #x << " = " << (x) << endl
#define getarr(arr, y) for(int i = 0; i < (y); i++) cin >> (arr)[i]
#define printarr(arr, y) for(int i = 0; i < (y); i++) cerr << i << " = " << (arr)[i] << endl
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;
int main(){
fast_io;
str in, h("hello");
int last = 0;
bool found;
cin >> in;
// cout << in;
for(int j = 0; j < h.length(); j++){
found = false;
for(int i = last; i < in.length(); i++) {
// debug(in[i]);
// debug(h[j]);
if (in[i] == h[j]) {
last = i + 1;
found = true;
break;
}
}
// debug(last);
// debug(found);
cout << endl << endl;
if(!found){
cout << "NO";
return 0;
}
}
cout << "YES";
return 0;
}