(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 ...
随机推荐
- Hive—简单窗口分析函数
hive 窗口分析函数 : jdbc:hive2:> select * from t_access; +----------------+---------------------------- ...
- Spring WebMVC 4.1返回json时 406(Not Acceptable)
1.问题现象Tomcat7+Spring4.1.4,返回json字符串时发生406错误 The resource identified by this request is only capable ...
- Linux 线程调度
1.线程sleep()后,会让出cpu的时间片,交由其他线程进行抢占cpu. 线程之间正常的切换是依靠时间片的. 当主线程没有结束,且其在所占有的时间片内,并没有结束自己的工作,此时,子线程将会抢占c ...
- 通过dockerfile构建nginx
上次 利用命令行的形式来构建nginx服务, http://www.cnblogs.com/loveyouyou616/p/6806788.html 这次利用dockerfile文件来构建nginx服 ...
- springmvc中@RequestMapping的使用
通过RequestMapping注解可以定义不同的处理器映射规则. 1.1 URL路径映射 @RequestMapping(value="/item")或@RequestMappi ...
- Python发送邮件不需要发件人密码认证
#!/usr/bin/python # coding: UTF-8 import smtplib from email.mime.text import MIMEText receivers_list ...
- Windows 7 手动添加受信任证书教程
步骤如下: 1.点击开始-运行,如下图: 2.弹出"控制台"窗口如下,如下图: 3.点击"文件-添加/删除管理单元",如下图: 4.选择"证书&quo ...
- 合成冷色黑暗恐怖魔法师图片的PS教程
教程主要使用Photoshop合成黑暗风格的魔法师施法场景,整体的场景效果以冷色风格为主,加上素材的叠加完成最终效果图,希望朋友可以喜欢.效果图: 先把背景拖进去,用工具吧字母弄掉. 加一个调色图层 ...
- 摹客项目在2018年工信部"创客中国"名列10强并荣获二等奖
2018“创客中国”互联网+大数据创新创业大赛(暨2018创客中国产业投资峰会)8月19日在厦门进行了总决赛.大赛由国家工业和信息化部.厦门市人民政府主办,厦门文广集团等承办.工信部信息中心领导.厦门 ...
- common常用到的类
org.apache.commons.codec.digest.DigestUtils.md5Hex(String) md5