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 ...
随机推荐
- Codeforces Round #349 (Div. 2) C. Reberland Linguistics DP+set
C. Reberland Linguistics First-rate specialists graduate from Berland State Institute of Peace a ...
- Qt5.8 提供 Apple tvOS,watchOS的技术预览版
New Platforms Apple tvOS (technology preview) Apple watchOS (technology preview) https://wiki.qt.io/ ...
- ubuntu之修改ls显示颜色
Linux 系统中 ls 文件夹的痛苦我就不说了,为了不伤眼睛,一般 ssh 终端背景都用的黑色,文件夹又是你妈的深蓝色,每次看文件夹都要探头仔细去看.这下彻底解决这个问题. 因为ubuntu下的 ...
- PyQt5信号-槽机制
signal -> emit -> slot signal.connect(slot) signal.disconnect(slot) 信号 (singal) 可以连接无数多个槽 (slo ...
- Irrlicht 1.8.4 + Win7 + VC2015 + x64 +OpenGL编译
1. 下载irrlicht1.8.4 https://nchc.dl.sourceforge.net/project/irrlicht/Irrlicht%20SDK/1.8/1.8.4/irrlich ...
- Redis五种数据类型及应用场景
MySql+Memcached架构的问题 实际MySQL是适合进行海量数据存储的,通过Memcached将热点数据加载到cache,加速访问,很多公司都曾经使用过这样的架构,但随着业务数据量的不断增加 ...
- c语言system()介绍
2013-09-0916:06:02 1. 头文件: #include <stdlib.h> 2. 定义函数: int system(const char * string); 3. 函数 ...
- python ansible api
#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : test2.py # @Author: Anthony.waa # @Date : 20 ...
- IOS-UITextField-改变光标颜色
方法1: [[UITextField appearance] setTintColor:[UIColor blackColor]]; 这种方法将影响所有TextField. 方法2: textFiel ...
- lua环境变量
function foo() print(g or "'g' is not defined!") end foo() env = { g = 100, print = print ...