HDU-4847 Wow! Such Doge!,模拟!】的更多相关文章

Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2351    Accepted Submission(s): 1445 Problem Description Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Internet Mem…
Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme. Wow.". Gawker. Retrieved November 22, 2013. Doge is an Internet meme that became popular in 2013. The meme typically con- sists of a picture of a Shi…
HDU 4847 Wow! Such Doge! pid=4847" style="">题目链接 题意:给定文本,求有几个doge,不区分大写和小写 思路:水题.直接一个个读字符每次推断就可以 代码: #include <stdio.h> #include <string.h> char c; char a[5]; int main() { a[5] = '\0'; int ans = 0; while ((c = getchar()) != E…
http://acm.hdu.edu.cn/showproblem.php?pid=4847 Wow! Such Doge! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4847 Description Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Inter…
Wow! Such Doge! 题意:给定的字符串中doge出现了多少次,直接模拟即可,不用KMP. char s[N]; int main() { // int n; int ans=0; while(gets(s)) { for(int i=0; s[i]!='\0'; i++) if(s[i]>='A'&&s[i]<'z') { if(s[i]=='d'||s[i]=='D') { if(s[i+1]=='o'||s[i+1]=='O') { if(s[i+2]=='g'…
作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree/p/4080264.html 题目链接:hdu 4850 Wow! Such String! 欧拉回路 长度为4的由26个字母组成的字符串一共有$4^{26}$种,从aaaa开始,在加上结尾的aaa那么该字符串长度为$4^{26}+3$.当字符串i的后三个字母和字符串j的前三个字母相同则ij有一条边,遍历所有的边可以构成一个欧拉回路. 首先构造aaaabbbb...zzzz的字符串,然后依次向结尾…
HDU 4041 Eliminate Witches! (模拟题 ACM ICPC 2011 亚洲北京赛区网络赛题目) Eliminate Witches! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 863    Accepted Submission(s): 342 Problem Description Kaname Mado…
题目链接:hdu 4983 Wow! Such Sequence! 题目大意:就是三种操作 1 k d, 改动k的为值添加d 2 l r, 查询l到r的区间和 3 l r. 间l到r区间上的所以数变成近期的斐波那契数,相等的话取向下取. 解题思路:线段树.对于每一个节点新增一个bool表示该节点下面的位置是否都是斐波那契数. #include <cstdio> #include <cstring> #include <cstdlib> #include <algo…
题目:hdu4847:Wow! Such Doge! 题目大意:在给出的段落里面找出"doge"出现的次数.大写和小写都能够. 解题思路:字符串匹配问题,能够在之前将字母都转换成统一格式. 代码: #include <stdio.h> #include <string.h> const int N = 1e6; char str[N]; const char *s1 = "doge"; int find () { int sum = 0; c…
HDU 4850 Wow! Such String! 题目链接 题意:求50W内的字符串.要求长度大于等于4的子串,仅仅出现一次 思路:须要推理.考虑4个字母的字符串,一共同拥有26^4种,这些由这些字符串.假设一个字符串末尾加上一个字符.能够变成还有一个字符串的话,就当作这有一条边,每多一个字符多一个结点,那么对于这道题目,一共就能有26^4 + 3条边,在加上尾巴能够多放3个,一共是26^4+3个边.这些边所有连起来就是要的字符串,这样就能够知道每一个节点会经过的次数为26,这样就仅仅要考虑…