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. 【转】【Android UI设计与开发】之详解ActionBar的使用,androidactionbar

    原文网址:http://www.bkjia.com/Androidjc/895966.html [Android UI设计与开发]之详解ActionBar的使用,androidactionbar 详解 ...

  2. js中iframe的用法

    最近遇到的项目总是习惯左边一个树,点击每个树的节点右边出现相应的信息,遇到这种情况用iframe还是很简单的, 例如 : 页面文件 @section Tree{ <ul id="tre ...

  3. guestfish 修改 image file

    Example guestfish sessionSometimes, you must modify a virtual machine image to remove any traces of ...

  4. libvirtsAPI

    mongodb远程服务器连接 mongo -uroot -p321 master.puppet.org:27017/admin

  5. Java快速排序

    快速排序: public int Partition(int[] nums, int low, int high) { int pivot = nums[low]; while (low < h ...

  6. zepto笔记

    $.contains: 判断节点是否存在的很好方式[另一个提供类似功能的函数是has] $.grep: 过滤数组 $.type: 获取变量类型 $.closest: 返回最先匹配到的祖先元素 $.ma ...

  7. Mongodb 条件查询

    1.1 查询出所有数据的指定键(name ,age ,country) db.persons.find({},{name:1,age:1,country:1,_id:0}) 2.查询条件 2.查询条件 ...

  8. php增删改查,自己写的demo

    1.链接数据库通用方法:conn.php <?php //第一步:链接数据库 $conn=@mysql_connect("localhost:3306","root ...

  9. ActiveReport 9手把手搭建环境及实战

    本文借鉴葡萄城空间产品,纯属分享,无任何营利目的 下载ActiveReports 9 专业版 打开下面的网站,点击立即下载,请您填写真实电子邮件地址,以获取ActiveReports产品试用版---系 ...

  10. Swift缩水版MJExtension - Reflect的基本使用

    github:https://github.com/CharlinFeng/Reflect 直接拖拽Reflect文件夹到您的项目中即可,无任何第三方依赖!文件夹结构说明:.Coding 归档相关.R ...