G. Fake News (easy)

Codeforces
IDCF802G
Time1000ms
Memory256MB
Difficulty
implementationstrings
English · Original
Chinese · Translation
Formal · Original
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 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 Output _YES_ if the string _s_ contains _heidi_ as a subsequence and _NO_ otherwise. [samples] ## Note A string _s_ contains another string _p_ as a subsequence if it is possible to delete some characters from _s_ and obtain _p_.
今天是4月1日,Heidi 怀疑她今天阅读的新闻是假的,她不想在所有参赛者面前出丑。她知道,如果一则新闻中包含 _heidi_ 作为子序列,那么它就是假的。请帮助 Heidi 判断给定的新闻是否真实,但请务必低调处理... 输入的第一行也是唯一一行包含一个非空字符串 #cf_span[s],其长度不超过 #cf_span[1000],由小写字母 (_a_-_z_) 组成。 如果字符串 #cf_span[s] 包含 _heidi_ 作为子序列,则输出 _YES_,否则输出 _NO_。 字符串 #cf_span[s] 包含另一个字符串 #cf_span[p] 作为 #cf_span(class=[tex-font-style-underline], body=[subsequence]),当且仅当可以通过从 #cf_span[s] 中删除某些字符得到 #cf_span[p]。 ## Input 输入的第一行也是唯一一行包含一个非空字符串 #cf_span[s],其长度不超过 #cf_span[1000],由小写字母 (_a_-_z_) 组成。 ## Output 如果字符串 #cf_span[s] 包含 _heidi_ 作为子序列,则输出 _YES_,否则输出 _NO_。 [samples] ## Note 字符串 #cf_span[s] 包含另一个字符串 #cf_span[p] 作为 #cf_span(class=[tex-font-style-underline], body=[subsequence]),当且仅当可以通过从 #cf_span[s] 中删除某些字符得到 #cf_span[p]。
Let $ s $ be a string of length at most 1000 over the alphabet $ \{a, b, \dots, z\} $. Let $ p = \texttt{"heidi"} $. Determine whether $ p $ is a subsequence of $ s $. Output "YES" if $ p \sqsubseteq s $, otherwise output "NO".
Samples
Input #1
abcheaibcdi
Output #1
YES
Input #2
hiedi
Output #2
NO
API Response (JSON)
{
  "problem": {
    "name": "G. Fake News (easy)",
    "description": {
      "content": "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 co",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF802G"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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 co...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "今天是4月1日,Heidi 怀疑她今天阅读的新闻是假的,她不想在所有参赛者面前出丑。她知道,如果一则新闻中包含 _heidi_ 作为子序列,那么它就是假的。请帮助 Heidi 判断给定的新闻是否真实,但请务必低调处理...\n\n输入的第一行也是唯一一行包含一个非空字符串 #cf_span[s],其长度不超过 #cf_span[1000],由小写字母 (_a_-_z_) 组成。\n\n如果字符串 #cf_...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "Let $ s $ be a string of length at most 1000 over the alphabet $ \\{a, b, \\dots, z\\} $.  \nLet $ p = \\texttt{\"heidi\"} $.  \n\nDetermine whether $ p $ is a subsequence of $ s $.\n\nOutput \"YES\" if $ p \\sqsub...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments