zoukankan      html  css  js  c++  java
  • hdu 5284 BestCoder Round #48 ($) 1001 水题 *

    题意:看一个字符串中是否包含顺序的  w  y  h ,字符之间可以有其他字符,并且如果有多个连续的vv,则可以看做一个w

    比较水,直接看代码

     1 #include<cstdio>
     2 #include<iostream>
     3 #include<algorithm>
     4 #include<cstring>
     5 #include<cmath>
     6 #include<queue>
     7 #include<map>
     8 using namespace std;
     9 #define MOD 1000000007
    10 const int INF=0x3f3f3f3f;
    11 const double eps=1e-5;
    12 typedef long long ll;
    13 #define cl(a) memset(a,0,sizeof(a))
    14 #define ts printf("*****
    ");
    15 const int MAXN=1005;
    16 int n,m,tt;
    17 char s[3145729];
    18 char s1[4]={'w','y','h'};
    19 int main()
    20 {
    21     int i,j,k;
    22     #ifndef ONLINE_JUDGE
    23     freopen("1.in","r",stdin);
    24     #endif
    25     scanf("%d",&tt);
    26     while(tt--)
    27     {
    28         scanf("%s",&s);
    29         int len=strlen(s);
    30         int tot=0;
    31         for(i=0;i<len;i++)
    32         {
    33             if(s[i]==s[i+1]&&s[i]=='v')
    34             {
    35                 s[i]='w';
    36             }
    37             if(s[i]==s1[tot])
    38             {
    39                 tot++;
    40             }
    41         }
    42         if(tot==3)
    43         {
    44             printf("Yes
    ");
    45         }
    46         else printf("No
    ");
    47     }
    48 }
  • 相关阅读:
    vue移动端适配
    vue根据状态改变文字颜色
    vue使用富文本插件
    小程序echart使用
    小程序日历状态圆点
    echars属性详解
    小程序vant文档地址
    vue根据不同文字切换显示不同颜色
    小程序获取用户手机号码
    小程序图片上传
  • 原文地址:https://www.cnblogs.com/cnblogs321114287/p/4657836.html
Copyright © 2011-2022 走看看