CF802G Fake News (easy)
题意翻译
给定一个字符串询问能否听过删除一些字母使其变为“heidi”
如果可以输出“YES”,不然为“NO”
题目描述
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...
输入输出格式
输入格式:
The first and only line of input contains a single nonempty string ss of length at most 10001000 composed of lowercase letters (a-z).
输出格式:
Output YES if the string ss contains heidi as a subsequence and NO otherwise.
输入输出样例
说明
A string ss contains another string pp as a subsequence if it is possible to delete some characters from ss and obtain pp .

#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
char ch[];
queue<char> que;
int main() {
que.push('h');que.push('e');que.push('i');
que.push('d');que.push('i');cin>>ch;
int len=strlen(ch);
for(int i=;i<len;i++)
if(!que.empty())
if(ch[i]==que.front())
que.pop();
if(que.empty()) cout<<"YES";
else cout<<"NO";
}
CF802G Fake News (easy)的更多相关文章
- Helvetic Coding Contest 2017 online mirror (teams allowed, unrated)
G. Fake News (easy) time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces 802 补题
codeforces802 A-O Helvetic Coding Contest 2017 online mirror A Heidi and Library (easy) 水题 同B #incl ...
- Collective Mindsets (easy)(逻辑题)
Collective Mindsets (easy) Time Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d &am ...
- 【转】Windows下使用libsvm中的grid.py和easy.py进行参数调优
libsvm中有进行参数调优的工具grid.py和easy.py可以使用,这些工具可以帮助我们选择更好的参数,减少自己参数选优带来的烦扰. 所需工具:libsvm.gnuplot 本机环境:Windo ...
- Struts2 easy UI插件
一.easy UI是类似于jQuery UI的插件库,它提供了丰富的各种常用插件:tree.datagrid... tree插件: 语法:$(selector).tree([settings]); 常 ...
- Easy UI常用插件使用
一.easy UI是类似于jQuery UI的插件库,它提供了丰富的各种常用插件:tree.datagrid... tree插件: 语法:$(selector).tree([settings]); 常 ...
- UVA-11991 Easy Problem from Rujia Liu?
Problem E Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for ...
- CodeForces462 A. Appleman and Easy Task
A. Appleman and Easy Task time limit per test 1 second memory limit per test 256 megabytes input sta ...
- easy ui插件
简介: easy UI是类似于jQuery UI的插件库 注意:多脚本同时使用时,注意脚本冲突问题. 常用插件: 1.tree插件(tree插件实现动态树形菜单) 2.datagrid插件(datag ...
随机推荐
- Oracle 数据块损坏与恢复具体解释
1.什么是块损坏: 所谓损坏的数据块,是指块没有採用可识别的 Oracle 格式,或者其内容在内部不一致. 通常情况下,损坏是由硬件故障或操作系统问题引起的.Oracle 数据库将损坏的块标识为&qu ...
- 【SDOI 2010】 古代猪文
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1951 [算法] 欧拉定理+中国剩余定理 + lucas定理 [代码] #includ ...
- thinkphp 内存查询表 防止多次查库
//从内存查询 表 以防止多次查库 private static function selectTable($tableName,array $where,$getFirst=false){ $res ...
- Comparable与Comparator源码分析
package java.lang; import java.util.*; /** * This interface imposes a total ordering on the objects ...
- kafka+storm 单机运行
环境: 1.kafka+zookeeper 2.window平台 3.eclipse 设置: 1.kafka和zookeeper安装,另一篇有介绍(https://www.cnblogs.com/51 ...
- Linux Shell Scripting Cookbook 读书笔记 5
sed,awk 1. sed (string editor) 使用-i可以将结果运用于原文件 sed 's/text1/text2/' file > newfile mv newfile fil ...
- Redis List 命令技巧
1.实现栈的功能(先进后出) lpush + lpop = stack > lpush mylist (integer) > lpop mylist " > lpop my ...
- BeautifulSoup 库的使用记录
BeautifulSoup 有何用途 如果我们需要通过脚本来抓取网络中的数据时,使用传统的字符解析等方法时是非常低效的,而BeautifulSoup则可以方便的通过接口来获取标签中所想要得到的数据.主 ...
- V4L2框架之视频监控
[参考]韦东山 教学视频 一. V4L2框架: video for linux version 2 虚拟视频驱动vivi.c分析:1.分配video_device2.设置3.注册:video_regi ...
- 在MyEclipse中使用debug模式
转:http://blog.csdn.net/competerh_programing/article/details/6773371 1, 首先在一个java文件中设断点,然后运行,当程序走到断点 ...