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 ...
随机推荐
- Juniper路由器
Juniper路由器入门之一:需要子接口的端口配置 set interfaces fe-2/0/1 vlan-tagging ――――在配置接口启用封装VLAN set in ...
- Hdu-6249 2017CCPC-Final G.Alice’s Stamps 动态规划
题面 题意:给你n个集合,每个集合有L到R这些种类的邮票,让你选择其中的K个集合,使得最后选择的邮票种类尽可能多,N,L,R都<=2000 题解:容易乱想到网络流,可是再细想一下就会发现处理不了 ...
- iOS数组越界
数组越界就是假如你的下标总数现在为32个,然后你在下一秒又执行了一个方法要从50个数据里进行赋值啊筛选之类的,而你此时数组里的值为32个,50的数据还没有请求到,往往会出现数组越界的崩溃信息,大概是这 ...
- C++批量加载动态库函数方法
1.枚举定义enum { // 0 - GigE DLL (implicitly called) Func_isVersionCompliantDLL, Func_isDriver ...
- JavaScriptResult
- express搭建一个web服务器
npm install express -g express这个库可以使用了. npm install express-generator -g ...
- 高德地图开发之获取SHA1码
通过Android Studio获取SHA1 第一步.打开 Android Studio 的 Terminal 工具. 第二步.输入命令:keytool -v -list -keystore key ...
- 关于maven-基本
笔记 Maven项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具. Maven是一个项目管理工具,它包含了一个项目对象模型 (Project Object ...
- 洛谷P3807 【模板】卢卡斯定理_组合数学模板
Code: #include<cstdio> using namespace std; typedef long long LL; const int maxn=1000000+2; LL ...
- 路飞学城Python-Day182
Evernote Export 集群介绍 1.集群介绍 集群:将多个物理机器组成一个逻辑计算机,实现负载和容错 计算机集群简称集群,是一种计算机系统,它通过一组松散集成的计算机软件或硬件连接起来高度紧 ...