代码:

#include<cstdio>
#include<cstring>
using namespace std; char s[200000]; int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%s",s);
int w=0,y=0,h=0;
int len=strlen(s);
for(int i=0; i<len; i++)
{
if(w==0&&s[i]=='w')
{
w=1;
continue;
}
if(w==0&&i>=1&&s[i]=='v'&&s[i-1]=='v')
{
w=1;
s[i]=s[i-1]='a';
continue;
}
if(w==1&&y==0&&s[i]=='y')
{
y=1;
continue;
}
if(w==1&&y==1&&h==0&&s[i]=='h')
{
h=1;
break;
}
}
if(w==1&&y==1&&h==1)
printf("Yes\n");
else
printf("No\n");
} return 0;
}

hdu 5284 wyh2000 and a string problem(没有算法,仅仅考思维,字符数组得开20万,不然太小了)的更多相关文章

  1. HDU 5284 wyh2000 and a string problem(字符串,水)

    题意:比如给你一个串,要求判断wyh是不是它的子序列,那么你只需要找一个w,找一个y,再找一个h,使得w在y前面,y在h前面即可.有一天小学生拿着一个串问他“wyh是不是这个串的子序列?”.但是wyh ...

  2. bestcoder 48# wyh2000 and a string problem (水题)

    wyh2000 and a string problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K ...

  3. String类的实现,内部采用字符数组实现

    #include <iostream> using namespace std; class String{ public: String(const char *str = NULL); ...

  4. 将string str中的str转换成字符数组

    #include <iostream> #include <map> #include <string.h> using namespace std; int ma ...

  5. Java中字符数组、String类、StringBuffer三者的相互转换

    一.StringBuffer与String的相互转换 1.将StringBuffer转换成String StringBuffer类成员toString函数可将其转换成String类型. StringB ...

  6. java实验五——字符数组、String、StringBuffer的相互转化,StringBuffer的一些方法

    package hello; import java.util.Scanner; public class 实验五 { public static void main(String[] args) { ...

  7. C++string,char* 字符数组,int类型之间的转换

    string.int 常见类型之间相互转换 int & string 之间的转换 C++中更多的是使用流对象来实现类型转换 针对流对象 sstream实现 int,float 类型都可以实现 ...

  8. hdu String Problem(最小表示法入门题)

    hdu 3374 String Problem 最小表示法 view code#include <iostream> #include <cstdio> #include &l ...

  9. HDU 3374 String Problem(KMP+最大/最小表示)

    String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

随机推荐

  1. uva1214 Manhattan Wiring 插头DP

    There is a rectangular area containing n × m cells. Two cells are marked with “2”, and another two w ...

  2. npm下载包失败的几个原因

    1. 可能是由于网络问题导致下载包失败,因为qiang,所以,直接使用npm有些情况会导致下载包失败,使用cnpm源或者yarn下载等方法可以解决这个问题. 2. 这个包不存在,检查一下包的拼写或者路 ...

  3. 使用vue-cli开发时跨域问题

    打开config文件夹下的index.js,配置proxyTable: { ... dev:{ ... proxyTable: { '/api': { target: 'http://localhos ...

  4. 转:android service总结2

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/11952435 相信大多数朋友对Service这个名词都不会陌生,没错,一个老练的A ...

  5. Error C1189: #error: Please use the /MD switch for _AFXDLL builds(转)

    原文转自 https://www.cnblogs.com/zwh0214/p/6048360.html 在VS 2013中编译程序时出现错误: 错误提示1: error C1189: #error : ...

  6. (转)HTML5 本地数据库(SQLite) 示例

      HTML5 本地数据库(SQLite) 示例 2012-05-07 16:21:13 标签:SQLite HTML5本地数据库 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作 ...

  7. Linux中tty框架与uart框架之间的调用关系剖析【转】

    转自:http://developer.51cto.com/art/201209/357501.htm 之前本人在"从串口驱动的移植看linux2.6内核中的驱动模型 platform de ...

  8. selenium的动作链 actionchains

    click(on_element=None) ——单击鼠标左键 click_and_hold(on_element=None) ——点击鼠标左键,不松开 context_click(on_elemen ...

  9. django的url匹配流程

    URL匹配流程(路由解析顺序): URL匹配流程说明 域名.端口.端口后的 /,以及查询字符串(问号后面的键值参数)不参与匹配 先到项目下的 urls.py 进行匹配,再到应用的 urls.py 匹配 ...

  10. 第四步:查看StandardAnalyzer的分词效果并添加停用词

    LUCENE的创建索引有好多种分词方式,这里我们用的StandardAnalyzer分词 package cn.lucene; import java.io.IOException; import o ...