(KMP 水)Wow! Such Doge! -- hdu -- 4847
http://acm.hdu.edu.cn/showproblem.php?pid=4847
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
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 Shiba Inu dog ac- companied by multicolored text in Comic Sans MS font in the foreground. The text, representing a kind of internal monologue, is deliberately written in broken English, and usually contains the word “wow” and the phrases “such x”, “much x”, “many x”, “very x” and “so x”.
Kabosu, the Shiba Inu featured in the original meme, was first pictured in a 2010 blog post by Atsuko Sato, a Japanese kindergarten teacher. Afterwards, varia- tions of the pictures using overlaid Comic Sans text were posted from a Tumblr blog, Shiba Confessions. However, the use of the intentionally misspelled “doge” dates back to June 2005, when it was mentioned in an episode of Homestar Runners puppet series.
In August 2013, images of the meme were spammed on Reddit’s r/MURICA subreddit by 4chan’s random imageboard, /b/. A search of the term doge on Google Trends shows an explosion of popularity occurring in October 2013, and more so in the following month. By November 2013, the meme had become widespread on the Internet. Google later created a Doge Easter egg: when doge meme was entered into the YouTube search bar, all of the site’s text would be displayed in colorful Comic Sans, similar to the kind used by the meme.
The meme was ranked #12 on MTV’s list of “50 Things Pop Culture Had Us Giving Thanks For” in 2013. Io9 compared the internal dialog of the Shiba Inu dogs to lolcat-speak. The image most commonly associated with the meme is of a female Shiba Inu named Kabosu, taken from a Japanese blog documenting the dog’s daily activities. The spelling of doge has several variants, leading to debate on its actual pronunciation. On December 13, Doge was named the “top meme” of 2013 by Know Your Meme.
In December 2013, the Dogecoin was introduced as a new cryptocurrency, making it the first cryptocurrency to be based on an Internet meme; the viral phenomenon, along with usage of the Comic Sans MS typeface, gave it “the Internet density of a large star” according to Medium writer Quinn Norton.
In late December 2013, members of the U.S. Congress produced material in the meme’s style. Huffington Post commented that Doge was “killed” because of the Congress members’ usage of the meme.
By early 2014, Doge’s popularity was sustained by internet communities on social media, accompanied by the rapid growth and acceptance of Dogecoin. In April 2014, Doge experienced a second major media resurgence due to revelations of the Dogecoin community’s intent to sponsor Josh Wise in NASCAR and place a picture of the Shiba Inu on his vehicle.
―― Doge (meme). (2014, May 18).
In Wikipedia, The Free Encyclopedia. Retrieved 02:00, May 22, 2014, from
http://en.wikipedia.org/w/index.php?title=Doge_(meme)&oldid=609040691
Now, Doge wants to know how many words “doge” are there in a given article. Would you like to help Doge solve this problem?
Input
The size of the article does not exceed 64KB. The article contains only ASCII characters.
Output
Sample Input
dOge
dogedoge
Sample Output
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm> using namespace std;
#define INF 0x3f3f3f3f
#define N 1000007 char M[N], S[N]="doge";
int Next[N], ans; void FindNext(char m[])
{
int i=, j=-;
int mlen = strlen(m);
Next[] = -; while(i<mlen)
{
if(j==- || m[i]==m[j])
Next[++i] = ++j;
else
j = Next[j];
}
} void KMP(char M[], char S[])
{
int i=, j=;
int Mlen = strlen(M), Slen = strlen(S); while(i<Mlen)
{
while(j==- || ((M[i]==S[j] || M[i]-'A'+'a'==S[j]) && i<Mlen && j<Slen))
i++, j++; if(j==Slen)
ans++; j = Next[j];
}
} int main()
{
int sum = ; FindNext(S); while(gets(M))
{
ans = ; KMP(M, S); sum += ans;
} printf("%d\n", sum);
return ;
}
(KMP 水)Wow! Such Doge! -- hdu -- 4847的更多相关文章
- Wow! Such Doge! - HDU 4847 (水题)
题目大意:题目描述了一大堆.....然而并没什么用,其实就是让求给的所有字符串里面有多少个"doge",不区分大小写. 代码如下: ====================== ...
- Wow! Such Doge! HDU - 4847(虽然是道水题 但很有必要记一下)
就是求出现了多少次doge 不区分大小写 巧用字符串函数 isalpha 判断是否是字母 tolower 转换为小写字母 toupper 转换为大写字母 strncmp字符串比较函数 能限制比较的 ...
- HDU 4847 陕西邀请赛A(水)
HDU 4847 Wow! Such Doge! pid=4847" style="">题目链接 题意:给定文本,求有几个doge,不区分大写和小写 思路:水题.直 ...
- HDU 4847 Wow! Such Doge!
Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- HDU-4847 Wow! Such Doge!,模拟!
Wow! Such Doge! 题意:给定的字符串中doge出现了多少次,直接模拟即可,不用KMP. char s[N]; int main() { // int n; int ans=0; whil ...
- poj-2406(kmp水题)
题意:定义一个a*b=字符串a连接字符串b:给你一个字符串s,问你这个字符串最多能用多少个字符串t连接得到:例如:aaaa=4个a构成: 解题思路:kmp水题,next数组除了查找字串以外最广泛的一种 ...
- hdu4847:Wow! Such Doge!(字符串匹配)
题目:hdu4847:Wow! Such Doge! 题目大意:在给出的段落里面找出"doge"出现的次数.大写和小写都能够. 解题思路:字符串匹配问题,能够在之前将字母都转换成统 ...
- HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme. ...
- hdu4847 Wow! Such Doge! KMP
Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Internet Meme. Wow.”. Gawker. Retrieved ...
随机推荐
- RISC处理器
RISC(精简指令集算法)处理器是经过硬件的精简只执行很有限的最常用的那部分指令的处理器.因为通过研究发现,只有 大约 20%的指令是最常用的,把处理器能执行的指令数目减少到 最低限度,对它们的执行 ...
- VS Code常用快捷键总结
目录: 1.主命令框 2.常用快捷键 (1) 编辑器与窗口管理 (2) 代码编辑 <1> 格式调整 <2> 光标相关 <3> 重构代 ...
- 八大排序算法python实现
一.概述 排序有内部排序和外部排序,内部排序是数据记录在内存中进行排序,而外部排序是因排序的数据很大,一次不能容纳全部的排序记录,在排序过程中需要访问外存. 我们这里说说八大排序就是内部排序. 当 ...
- python并行编程
一.编程思想 并行编程的思想:分而治之,有两种模型 1.MapReduce:将任务划分为可并行的多个子任务,每个子任务完成后合并得到结果 例子:统计不同形状的个数. 先通过map进行映射到多个子任务, ...
- SQL数据库简单的建立与操作
数据类型 符号标志 整数型 bigint,int,smallint,mediumint,tinyint 精确数值型 decimal,numeric 浮点型 float,real,double 位型 b ...
- Python3 range() 函数用法
Python3 range() 函数用法 Python3 内置函数 Python3 range() 函数返回的是一个可迭代对象(类型是对象),而不是列表类型, 所以打印的时候不会打印列表. Pyth ...
- Mybatis的分页插件PageHelp:Page对象中的pageSize等属性无法序列化,无法转换为json字符串
Page<User> page = new Page<>(); User user = new User(); user.setAge(20); ...
- DB2与oracle类型对比
本文摘自http://www.cnblogs.com/cy163/archive/2010/11/17/1880280.html 做过DB2数据库应用迁移的工程师,了解IBM MTK工具在迁移过程中所 ...
- PAT 1058 选择题(20)(代码+思路)
1058 选择题(20 分) 批改多选题是比较麻烦的事情,本题就请你写个程序帮助老师批改多选题,并且指出哪道题错的人最多. 输入格式: 输入在第一行给出两个正整数 N(≤ 1000)和 M(≤ 100 ...
- Codeforces 665A. Buses Between Cities 模拟
A. Buses Between Cities time limit per test: 1 second memory limit per test: 256 megabytes input: s ...