fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. void Fast();
  4. void solve();
  5. int main()
  6. {
  7. Fast();
  8. solve();
  9. return 0;
  10. }
  11. void Fast()
  12. {
  13. ios_base::sync_with_stdio(0);
  14. cin.tie(0);
  15. cout.tie(0);
  16. }
  17. void solve()
  18. {
  19. string s;
  20. cin >> s;
  21. int h = s.find('h');
  22. s[h] = '1';
  23. int e = s.find('e');
  24. s[e] = '1';
  25. int l1 = s.find('l');
  26. s[l1] = '2';
  27. int l2 = s.find('l');
  28. s[l2] = '1';
  29. int o = s.find('o');
  30. s[o] = '1';
  31. // cout << h << "\n";
  32. // cout << e << "\n";
  33. // cout << l1 << "\n";
  34. // cout << l2 << "\n";
  35. // cout << o << "\n";
  36. if ((o > l2 && o > l1 && o > e && o > h) && (l2 == l1 + 1) && (l2 > l1 && l2 > h && l2 > e && o > l2) && (o > l1 && l1 < l2 && l1 > e && l1 > h) && (e < l2 && e < l1 && e < o && e > h) && (l2 > h && l1 > h && e > h && o > h))
  37. cout << "YES\n";
  38. else
  39. cout << "NO\n";
  40. }
Success #stdin #stdout 0.01s 5548KB
stdin
Standard input is empty
stdout
NO