题意:比如给你一个串,要求判断wyh是不是它的子序列,那么你只需要找一个w,找一个y,再找一个h,使得w在y前面,y在h前面即可.有一天小学生拿着一个串问他“wyh是不是这个串的子序列?”.但是wyh2000有重度近视眼,如果字符串中有一段连续的v(至少两个),那么他会把它看成一个w.例如,字符串vvv会被看成w,字符串vvwvvv会被看成www,字符串vwvv会被看成vww.请问wyh2000会怎么回答这个问题?输出yes和no. 思路:其实就是将两个以上的v换成w,再来看是否能有'wyh'子…
代码: #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&&…
wyh2000 and a string problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 484    Accepted Submission(s): 232 Problem Description Young theoretical computer scientist wyh2000 is teaching you…
Problem - 3374   KMP求循环节. http://www.cnblogs.com/wuyiqi/archive/2012/01/06/2314078.html   循环节推导的证明相当的好,这题是很裸的套算法的题. 代码如下: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; ; char buf…
HDU 3374 String Problem (KMP+最大最小表示) String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1602    Accepted Submission(s): 714 Problem Description Give you a string with length N, you c…
String problem 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5772 Description This is a simple problem about string. Now a string S contains only '0'-'9'. ?? wants to select a subsequence from this string. And makes this subsequence score maximum.…
hdu 3374 String Problem 最小表示法 view code#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <map> #include <string> using namespace std; const int N = 10010; int n; char s[105]; map<…
String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2706    Accepted Submission(s): 1140 Problem Description Give you a string with length N, you can generate N strings by left shift…
String Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1492    Accepted Submission(s): 662 Problem Description Give you a string with length N, you can generate N strings by left shifts.…
 HDU 5285  wyh2000 and pupil Time Limit:1500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u   Description Young theoretical computer scientist wyh2000 is teaching his pupils. Wyh2000 has n pupils.Id of them are from  to .In order to inc…