代码:

#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. How to install VIB on VMware ESXi

    What is VIB? A vib is  vSphere Installation Bundle. To make it more detailed, one can look at the vS ...

  2. vs2012 有效产品密钥

    VS2012 有效注册密钥 下载地址:https://www.malavida.com/en/soft/visual-studio-2012/ Microsoft Visual Studio Ulti ...

  3. 汕头市队赛 SRM 09 B 撕书

    B 撕书II-3 SRM 09 背景&&描述 琉璃手头有一黑一白两本魔法书,一本是<缟玛瑙的不在证明>,另一本是<白色相簿1.5>     传说同时打开这两本书 ...

  4. JDK源码分析--Collections

    1. 集合框架图 2. HashMap 成员构成 HashMap是通过"拉链法"实现的哈希表.它包括几个重要的成员变量:table, size, threshold, loadFa ...

  5. COMPANY_点取消会卡死的解决方法

    // OLD void ctonedlg::onbtn_basedir_clicked() {     m_basedir = getUserSelectDir();     doSearchDir( ...

  6. ScrollLayer

    http://www.oschina.net/p/scrolllayer ScrollLayer 编辑/纠错 分享到:    已用    +1 收藏 +12 4月18日 武汉 源创会开始报名,送华为开 ...

  7. 【原创】Linux环境下的图形系统和AMD R600显卡编程(9)——R600显卡的3D引擎和图形流水线

    1. R600 3D引擎 R600核心是AMD一款非常重要的GPU核心,这个核心引入了统一处理器架构,其寄存器和指令集同以前的GPU 都完全不同,对其编程也有比较大的区别. 图1显示了R600 GPU ...

  8. android上USB Wifi调试记录

    https://wenku.baidu.com/view/cc3098c72f60ddccdb38a043.html?from=search

  9. (10)ubuntu内核源码树

    ubuntu内核源码树目录: root@ubuntu:/lib/modules/3.13.0-32-generic/build#

  10. centos7 挂载exfat格式的u盘

    下载 两个包 rpm -ivh http://download1.rpmfusion.org/free/el/updates/7/x86_64/f/fuse-exfat-1.2.8-1.el7.x86 ...