经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

Strings of Power  

📝 题解 🔵 仅限 C++
题目描述
<hr /> <p style="text-align:center;"> <span><span><span><span></span></span></span>题目已更正,可以提交</span> </p> <hr /> <hr /> <p> Volodya likes listening to heavy metal and (occasionally) reading. No wonder </p> <p> Volodya is especially interested in texts concerning his favourite music style. </p> <p> Volodya calls a string powerful if it starts with "heavy" and ends with "metal". Finding all powerful substrings (by substring Volodya means a subsequence of consecutive characters in a string) in a given text makes our hero especially joyful. Recently he felt an enormous fit of energy while reading a certain text. So Volodya decided to count all powerful substrings in this text and brag about it all day long. Help him in this difficult task. Two substrings are considered different if they appear at the different positions in the text. </p> <p> For simplicity, let us assume that Volodya's text can be represented as a single string.&nbsp; </p> <p> <br /> </p> <p> <br /> </p> <p> <br /> </p>
输入格式
<div class="page"> <div class="layoutArea"> <div class="column"> <p> Input contains a single non-empty string consisting of the lowercase Latin alphabet letters. Length of this string will not be greater than 1e6 characters.&nbsp; </p> </div> </div> </div>
输出格式
<div class="page"> <div class="layoutArea"> <div class="column"> <p> Print exactly one number — the number of powerful substrings of the given string.&nbsp; </p> </div> </div> </div>
样例
样例输入 1
heavymetalisheavymetal heavymetalismetal trueheavymetalissotruewellitisalsosoheavythatyoucanalmostfeeltheweightofmetalonyou
样例输出 1
3 2 3
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用