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?

InputAn article that Doge wants to know. 
 The size of the article does not exceed 64KB. The article contains only ASCII characters.OutputPlease output the number of word “doge” (case- insensitive). Refer to the samples for more details.Sample Input

adoge
cutedo
yourge
blownDoge
题意:好长啊啊啊啊啊啊啊啊,
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<cstdio>
#include<iomanip>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define pi acos(-1)
#define ll long long
#define mod 10007
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1 using namespace std; const double g=10.0,eps=1e-;
const int N=+,maxn=(<<)-,inf=0x3f3f3f3f; int Next[N],slen,plen,ans=;
string str,ptr; void getnext()
{
int k=-;
Next[]=-;
for(int i=;i<slen;i++)
{
while(k>-&&str[k+]!=str[i])k=Next[k];
if(str[k+]==str[i])k++;
Next[i]=k;
}
}
void kmp()
{
int k=-;
for(int i=;i<plen;i++)
{
while(k>-&&str[k+]!=ptr[i])k=Next[k];
if(str[k+]==ptr[i])k++;
if(k==slen-)
{
k=-;
ans++;
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie();
// cout<<setiosflags(ios::fixed)<<setprecision(2);
str="doge";
slen=str.size();
getnext();
string s;
while(getline(cin,s)){
ptr="";
for(int i=;i<s.size();i++)
{
if(s[i]>='A'&&s[i]<='Z')s[i]=s[i]-'A'+'a';
ptr+=s[i];
}
plen=ptr.size();
kmp();
}
cout<<ans<<endl;
return ;
}
还好只看了后面一段,就是找出一段话中的名狗doge(不区分大小写)
题解:kmp一步到位,和刚开始有一题很像
lovelyDooge
Wow! Such Dooooooooooooooge!!!
D0ge
dOge DOGE
dogedoge

Sample Output

6

hdu4847 kmp的更多相关文章

  1. hdu4847 Wow! Such Doge! KMP

    Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Internet Meme. Wow.”. Gawker. Retrieved ...

  2. 两种KMP题+KMP模版整理

    最近稍微看了下KMP,不是很懂他们大神的A题姿势,但是模版总该还是要去学的. 其中next数组的求法有两处区别. 第一种:求主串中模式串的个数.HDU2087 剪花布条和HDU4847 Wow! Su ...

  3. KMP算法求解

    // KMP.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<iostream> using namespac ...

  4. 简单有效的kmp算法

    以前看过kmp算法,当时接触后总感觉好深奥啊,抱着数据结构的数啃了一中午,最终才大致看懂,后来提起kmp也只剩下“奥,它是做模式匹配的”这点干货.最近有空,翻出来算法导论看看,原来就是这么简单(先不说 ...

  5. KMP算法

    KMP算法是字符串模式匹配当中最经典的算法,原来大二学数据结构的有讲,但是当时只是记住了原理,但不知道代码实现,今天终于是完成了KMP的代码实现.原理KMP的原理其实很简单,给定一个字符串和一个模式串 ...

  6. 萌新笔记——用KMP算法与Trie字典树实现屏蔽敏感词(UTF-8编码)

    前几天写好了字典,又刚好重温了KMP算法,恰逢遇到朋友吐槽最近被和谐的词越来越多了,于是突发奇想,想要自己实现一下敏感词屏蔽. 基本敏感词的屏蔽说起来很简单,只要把字符串中的敏感词替换成"* ...

  7. [KMP]【学习笔记】

    Oulipo Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 36916   Accepted: 14904 Descript ...

  8. KMP算法实现

    链接:http://blog.csdn.net/joylnwang/article/details/6778316 KMP算法是一种很经典的字符串匹配算法,链接中的讲解已经是很明确得了,自己按照其讲解 ...

  9. KMP专题

    1.[HDU 3336]Count the string(KMP+dp) 题意:求给定字符串含前缀的数量,如输入字符串abab,前缀是a.ab.aba.abab,在原字符串中出现的次数分别是2.2.1 ...

随机推荐

  1. linux基础命令---df

    df 显示磁盘分区上的磁盘使用状况,可以显示出文件系统名称.大小.挂载点等信息.df显示包含每个文件名参数的文件系统上可用的磁盘空间.如果不给出文件名,则显示所有当前挂载的文件系统上可用的空间.默认情 ...

  2. web前端----Bootstrap框架补充

    一.一个小知识点 1.截取长屏的操作 2.设置默认格式 3.md,sm, xs 4.空格和没有空格的选择器 二.响应式介绍 - 响应式布局是什么? 同一个网页在不同的终端上呈现不同的布局等- 响应式怎 ...

  3. (二) MySQL常用命令及语法规范

  4. Python入门之字符编码

    一.字节编码的基础知识 一.计算机基础知识 #1 我们的程序都是运行在特定的操作系统内,例如window,linux,mac等等#2 运行应用程序,需要要操作系统发出请求,我们双击运行的时候会向操作系 ...

  5. Github使用教程(二)------ Github客户端使用方法

    在上一篇教程中,我们简单介绍了Github网站的各个部分,相信大家对Github网站也有了一个初步的了解(/(ㄒoㄒ)/~~可是还是不会用怎么办),不要着急,我们今天先讲解一下Github for w ...

  6. keepalived+nginx实现HA高可用的web负载均衡

    Keepalived 是一种高性能的服务器高可用或热备解决方案, Keepalived 可以用来防止服务器单点故障的发生,通过配合 Nginx 可以实现 web 前端服务的高可用.Keepalived ...

  7. QtQuickcontrols2控件使用参考

    随着Qt的版本升级,其自带的controls控件库也不断升级,目前已经到了2.3的版本.本文通过解读Qt自带的gallery例程,说明新版本controls控件库的相关特性.其具体位置于: 因为相关的 ...

  8. 20145317彭垚《网络对抗》Exp9 Web安全基础实践

    20145317彭垚<网络对抗>Exp9 Web安全基础实践 基础问题回答 SQL注入攻击原理,如何防御? SQL注入攻击就是通过把SQL命令插入到Web表单递交或输入域名或页面请求的查询 ...

  9. 20145324王嘉澜 《网络对抗》进阶实践之 shellcode注入和Return-to-libc攻击深入

    Shellcode注入 •Shellcode实际是一段代码,但却作为数据发送给受攻击服务器,将代码存储到对方的堆栈中,并将堆栈的返回地址利用缓冲区溢出,覆盖成为指向 shellcode的地址 •实验参 ...

  10. 20145332 MAL_简单后门

    20145332 MAL_简单后门 用NC获取远程主机的shell 2.1.1 Windows获得Linux的权限 首先要在Windows主机下安装ncat.exe,安装完成后需要配置环境变量path ...