hdu4847 Wow! Such Doge! KMP
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?
说了这么多,就是在文本中找'doge'这个词出现了多少次。
KMP裸匹配一下就行了。
#include<stdio.h>
#include<string.h> const int maxn=1e6+;
const int maxm=1e4+; char s[maxn],t[]="doge";
int p[]; int main(){
int m=strlen(t);
int i,j,ans=;
p[]=p[]=; //初始化自匹配数组
for(i=;i<m;i++){ //自匹配
j=p[i];
while(j&&t[i]!=t[j])j=p[j];
p[i+]=t[i]==t[j]?j+:;
}
while(scanf("%s",s)!=EOF){
int n=strlen(s);
for(i=;i<n;++i)if(s[i]>='A'&&s[i]<='Z')s[i]=s[i]-'A'+'a';
j=; //注意 j=0
for(i=;i<n;i++){ //串匹配
while(j&&s[i]!=t[j])j=p[j];
if(s[i]==t[j])j++;
if(j==m){
ans++;
}
}
}
printf("%d\n",ans);
return ;
}
hdu4847 Wow! Such Doge! KMP的更多相关文章
- hdu4847:Wow! Such Doge!(字符串匹配)
题目:hdu4847:Wow! Such Doge! 题目大意:在给出的段落里面找出"doge"出现的次数.大写和小写都能够. 解题思路:字符串匹配问题,能够在之前将字母都转换成统 ...
- HDU-4847 Wow! Such Doge!,模拟!
Wow! Such Doge! 题意:给定的字符串中doge出现了多少次,直接模拟即可,不用KMP. char s[N]; int main() { // int n; int ans=0; whil ...
- hdu4847 Wow! Such Doge!(简单题+坑爹的输入)
转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents 题目链接:http://acm.hdu.edu.cn/showproblem.php ...
- (KMP 水)Wow! Such Doge! -- hdu -- 4847
http://acm.hdu.edu.cn/showproblem.php?pid=4847 Wow! Such Doge! Time Limit:1000MS Memory Limit:32 ...
- hdu4847 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! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- Wow! Such Doge!---hdu4847(字符串水题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4847 题意就是求给出的文章中共有多少个doge,不区分大小写直接用strstr做就可以了: #incl ...
- HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
Problem Description Chen, Adrian (November 7, 2013). "Doge Is An Ac- tually Good Internet Meme. ...
- Wow! Such Doge! - HDU 4847 (水题)
题目大意:题目描述了一大堆.....然而并没什么用,其实就是让求给的所有字符串里面有多少个"doge",不区分大小写. 代码如下: ====================== ...
随机推荐
- wpf自定义控件中使用自定义事件
wpf自定义控件中使用自定义事件 1 创建自定义控件及自定义事件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 ...
- 安装Adobe Acrobat XI Pro
从网上下载Adobe Acrobat XI Pro这款软件,下载后将其解压到我们的电脑上,然后找到setup.exe双击安装它,安装时选择“使用试用版本或订阅” 2 选择“自定义” 自定义安装组件 ...
- 【原创】<Debug> QT头文件
[Error] No such file or directory [Solution] 参考: http://blog.csdn.net/donglynn/article/details/21804 ...
- java -jar 使用要点
1.在将进程设为脱离终端运行时,输出流不能输出到当前窗口.否则,退出终端后,进程会pause.pause是停滞,是僵尸进程. 2.包含资源文件的war.jar文件是无法独立运行的.需要解压到临时目录. ...
- mySQL 分组查询,根据分组的字段,取最小值
今天看到别人问的问题,给别人写了一条sql! CREATE TEMPORARY TABLE tmp_table ( id INTEGER not NULL, uname VARCHAR(10) NOT ...
- Java 集成开发环境的介绍及下载
集成开发环境(integrated development environment,JDE) 之前成功运行了Java小程序是经历了先在笔记本中编写源代码,然后通过命令行运行打开javac编译源文件, ...
- 用Java给数组排序
public class BubbleDemo {public static void main(String[] args) { int arr[]={1,3,5,7,2,4,6,8,9}; bub ...
- excel的操作
python可以对excel进行写的操作,读的操作和修改的操作,做不同的功能需要导入不同的模块 1.对 excel进行写的操作 import xlwt book=xlwt.Workbook() #新建 ...
- leetcode55:跳跃游戏
解题思路1: 从头往后找每一个为0的元素,判断这个0能够跳过,所有的0都能跳过,则返回True,否则返回False 解题思路2: 从前往后遍历数组,设置一个访问到当前位置i时最远可调到的距离maxle ...
- springsecurity基于数据库验证用户
之前的springsecurity程序都是将数据存放在内存中的,通过 <security:user-service> <security:user name="user&q ...