1823.Fake News (easy)

Time Limit: 1s Memory Limit: 256MB

As it's the first of April, Heidi is suspecting that the news she reads today are fake, and she does not want to look silly in front of all the contestants. She knows that a newspiece is fake if it contains heidi as a subsequence. Help Heidi assess whether the given piece is true, but please be discreet about it...

Input Format(From the terminal/stdin)

The first and only line of input contains a single nonempty string s of length at most 1000 composed of lowercase letters (a-z).

Output Format(To the terminal/stdout)

Output YES if the string s contains heidi as a subsequence and NO otherwise.

Sample Input 1

Copy
abcheaibcdi
           \n

Sample Output 1

Copy
YES
   \n

Sample Input 2

Copy
hiedi
     \n

Sample Output 2

Copy
NO
  \n

Hints

A string s contains another string p as a subsequence if it is possible to delete some characters from s and obtain p.

Submit

请先 登录

© 2025 FAQs