hdu 5284 BestCoder Round #48 ($) 1001 水题 *
题意:看一个字符串中是否包含顺序的 w y h ,字符之间可以有其他字符,并且如果有多个连续的vv,则可以看做一个w
比较水,直接看代码
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
#define MOD 1000000007
const int INF=0x3f3f3f3f;
const double eps=1e-;
typedef long long ll;
#define cl(a) memset(a,0,sizeof(a))
#define ts printf("*****\n");
const int MAXN=;
int n,m,tt;
char s[];
char s1[]={'w','y','h'};
int main()
{
int i,j,k;
#ifndef ONLINE_JUDGE
freopen("1.in","r",stdin);
#endif
scanf("%d",&tt);
while(tt--)
{
scanf("%s",&s);
int len=strlen(s);
int tot=;
for(i=;i<len;i++)
{
if(s[i]==s[i+]&&s[i]=='v')
{
s[i]='w';
}
if(s[i]==s1[tot])
{
tot++;
}
}
if(tot==)
{
printf("Yes\n");
}
else printf("No\n");
}
}
hdu 5284 BestCoder Round #48 ($) 1001 水题 *的更多相关文章
- HDU5804 Price List (BestCoder Round #86 A)水题
分析:大于总和输出1 #include <cstdio> #include <cstring> #include <algorithm> using namespa ...
- BestCoder Round #65 hdu5590(水题)
ZYB's Biology Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)T ...
- HDU 5280 BestCoder Round #47 1001:Senior's Array
Senior's Array Accepts: 199 Submissions: 944 Time Limit: 2000/1000 MS (Java/Others) Memory Limit ...
- 字符串处理 BestCoder Round #43 1001 pog loves szh I
题目传送门 /* 字符串处理:是一道水题,但是WA了3次,要注意是没有加'\0'的字符串不要用%s输出,否则在多组测试时输出多余的字符 */ #include <cstdio> #incl ...
- 贪心 BestCoder Round #39 1001 Delete
题目传送门 /* 贪心水题:找出出现次数>1的次数和res,如果要减去的比res小,那么总的不同的数字tot不会少: 否则再在tot里减去多余的即为答案 用set容器也可以做,思路一样 */ # ...
- 暴力 BestCoder Round #46 1001 YJC tricks time
题目传送门 /* 暴力:模拟枚举每一个时间的度数 详细解释:http://blog.csdn.net/enjoying_science/article/details/46759085 期末考结束第一 ...
- HDU 2096 小明A+B --- 水题
HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen(&quo ...
- hdu 5667 BestCoder Round #80 矩阵快速幂
Sequence Accepts: 59 Submissions: 650 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536 ...
- hdu 5643 BestCoder Round #75
King's Game Accepts: 249 Submissions: 671 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 6 ...
随机推荐
- zabbix: failed to accept an incoming connection
错误描述 查日志发现: failed to accept an incoming connection: connection from "192.168.186.132" rej ...
- DedeCMS V5.7 Dialog目录下配置文件XSS漏洞
漏洞地址及证明:/include/dialog/config.php?adminDirHand="/></script><script>alert(1);< ...
- ps 倒影制作
首先打开PS并打开一张素材,这里我选择了山水图片,制作山峰在水中的倒影效果. 然后按下[Crrl+J]复制这个图层,如图: 接着按下[Ctrl+T]或者是[编辑][自由变换],打开[自由变换] ...
- 一机双mysql的安装和启动注意事项目
./configure --prefix=/usr/local/mysql5.1/ --with-mysqld-user=mysql --sysconfdir=/usr/local/mysql5.1/ ...
- Java对文件及文件夹的操作
public class FileOperater { // 验证字符串是否为正确路径名的正则表达式 private static String matches = "[A-Za-z]:\\ ...
- mingw32-g++.exe: *: No such file or directory错误解决方法
初次使用CodeBlocks,好不容易把环境配好, 编译没有错误了,但是程序并不生成exe,提示以下问题: mingw32-g++.exe: /W3: No such file or director ...
- linux基本命令(4)-8.Ubuntu-jdk+tomcat+eclipse软件包安装
第一步 安装jdk su - root 切换成root用户 sudo -i 不需要密码直接切换成root 1.进入usr目录 cd /usr 2.在usr目录下建立java安装目录 mkdir jav ...
- 新浪微博客户端(1)-实现Tabbar导航栏效果
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launc ...
- Nginx反向代理 负载均衡
nginx 这个轻量级.高性能的 web server 主要可以干两件事情: 〉直接作为http server(代替apache,对PHP需要FastCGI处理器支持): 〉另外一个功能就是作为反向代 ...
- [Effective JavaScript 笔记]第61条:不要阻塞I/O事件队列
js程序是构建在事件之上的.输入可能来自不同的外部源.在一些语言中,我们习惯地编写代码来等待某个特定的输入. var text=downloadSync('http://example.com/fil ...