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. mysql生成随机测试数据

    一个demo: CREATE TABLE dept_InnoDB(  deptno MEDIUMINT NOT NULL DEFAULT 0 ,  dname VARCHAR(20) NOT NULL ...

  2. AC自动机修正

    #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #inc ...

  3. HDU_2056——相交矩形的面积

    Problem Description Given two rectangles and the coordinates of two points on the diagonals of each ...

  4. 抓取“矢量”的实时交通流量数据

    1. 引言 最近老师有一个需求,就是想要抓取实时的矢量交通流量数据来做分析,类似于百度地图,高德地图的"实时路况"那种.平时的网络抓取工作一般是抓取网页上现成的数据,但是交通流量数 ...

  5. Eclipse默认配色的恢复方法

    Eclipse默认配色的恢复方法 很多搞开发的同学一开始不喜欢默认的eclipse白底配色,去网上千辛万苦搜到了很多黑底暗色的各种eclipse配色然后import上了,之后却发现并不适合自己,想找默 ...

  6. MKMapView and Zoom Levels: A Visual Guide

    原帖:http://troybrant.net/blog/2010/01/mkmapview-and-zoom-levels-a-visual-guide/ So, how exactly does ...

  7. 【Ruby on Rails学习二】在线学习资料的整理

    由于工作任务重,时间紧,没有太多学习的时间,大致找了些在线学习资料,这里做个整理,希望对同样准备学习的朋友有帮助 在线文档类: Ruby on Rails 实战圣经  使用 Rails 4.2 及 R ...

  8. 【转】 基于TFTP协议的远程升级设计

    版权声明:本文为博主原创文章,未经博主允许不得转载.联系邮箱:zhzhchang@126.com 说明:由于CSDN博客编辑器对word格式近乎不支持,因此对表格使用了图片方式(最后一个表格未使用图片 ...

  9. jQuery扩展与noConflict的用法-小示例

    有时我们要用到自己定义的jquery,这时可以通过jQuery扩展来实现该功能 index.html <!DOCTYPE html> <html> <head> & ...

  10. Shell入门第一课

    Shell是用C语言编写的程序. 几种常见的shell:bash.sh.csh.ksh等 bash是linux的默认标准shell, 完全兼容sh sh 是unix的默认 标准shell ash 是l ...