http://codeforces.com/contest/318/problem/B

 #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std; char str[]; int main()
{
cin>>str;
int k=strlen(str);
__int64 t=,ans=;
for(int i=; i<k; i++)
{
if(str[i]=='h'&&str[i+]=='e'&&str[i+]=='a'&&str[i+]=='v'&&str[i+]=='y'&&i+<k)
{
t++;
}
if(str[i]=='m'&&str[i+]=='e'&&str[i+]=='t'&&str[i+]=='a'&&str[i+]=='l'&&i+<k)
{
ans+=t;
}
}
cout<<ans<<endl;
return ;
}

cf Strings of Power的更多相关文章

  1. Codeforces Round #188 (Div. 2) B. Strings of Power 水题

    B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/p ...

  2. Strings of Power

    B. Strings of Power Volodya likes listening to heavy metal and (occasionally) reading. No wonder Vol ...

  3. XSS attack

    <html> <form action="" method="post"> <input type="text" ...

  4. Codeforces Round #188 (Div. 2) C. Perfect Pair 数学

    B. Strings of Power Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/318/p ...

  5. Codeforces Round #188 (Div. 1 + Div. 2)

    A. Even Odds 奇数个数\(\lfloor \frac{n+1}{2}\rfloor\) B. Strings of Power 从位置0开始,统计heavy个数,若当前为metal,则可以 ...

  6. POJ 2406 Power Strings (KMP)

    Power Strings Time Limit: 3000MSMemory Limit: 65536K Total Submissions: 29663Accepted: 12387 Descrip ...

  7. POJ 2406 Power Strings

    F - Power Strings Time Limit:3000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u S ...

  8. poj 2406:Power Strings(KMP算法,next[]数组的理解)

    Power Strings Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 30069   Accepted: 12553 D ...

  9. POJ 2406:Power Strings

    Power Strings Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 41252   Accepted: 17152 D ...

随机推荐

  1. 设计模式 ( 十六 ): Mediator中介者模式 -- 行为型

    1.概述 在面向对象的软件设计与开发过程中,根据“单一职责原则”,我们应该尽量将对象细化,使其只负责或呈现单一的职责,即将行为分布到各个对象中. 对于一个模块或者系统,可能由很多对象构成,而且这些对象 ...

  2. Design Tic-Tac-Toe 解答

    Question Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assum ...

  3. [LeetCode] 160. Intersection of Two Linked Lists 解题思路

    Write a program to find the node at which the intersection of two singly linked lists begins. For ex ...

  4. Hadoop生态圈技术图谱

    当下Hadoop已经成长为一个庞大的体系,貌似只要和海量数据相关的,没有哪个领域缺少Hadoop的身影,下面是一个Hadoop生态系统的图谱,详细的列举了在Hadoop这个生态系统中出现的各种数据工具 ...

  5. ELT工具Kettle之CDC(Change Data Capture)实现实例

    ETL过程的第一步就是从不同的数据源抽取数据并把数据存储在数据的缓存区.这个过程的主要挑战就是初始加载数据量大和比较慢的网络延迟.在初始加载完成之后,不能再把所有数据重新加载一遍,我们需要的只是变化的 ...

  6. github atom创建自己的语法高亮

    使用atom一段时间了,有些插件还不是很成熟.比如项目中使用protobuf,早就有人写了语法高亮(https://github.com/podgib/atom-protobuf),但是效果不是很好. ...

  7. C# 利用反射查看类的信息

    using System; using System.Collections; using System.Collections.Generic; using System.Reflection; u ...

  8. Matlab生成二类线性可分数据

    %% 生成二类线性可分数据 function [feature, category]=generate_sample(step,error) aa=3; %斜率 bb=3; %截距 b1=1; rr ...

  9. Face recognition using Histograms of Oriented Gradients

    Face recognition using Histograms of Oriented Gradients 这篇论文的主要内容是将Hog算子应用到人脸识别上. 转载请注明:http://blog. ...

  10. Hadoop 开源调度系统zeus(二)

    紧跟之前Hadoop 开源调度系统zeus(一) 本节主要介绍一下zeus的架构: 先给一个zeus的架构图 无论Master还是Worker都有一套WEB UI,无论从哪个上面去看,看到的结果都是一 ...