hdu_4847_kmp_水

原创 2017年10月06日 21:57:31

Wow! Such Doge!
Time Limit: 1000msMemory Limit: 32768KB This problem will be judged on HDU. Original ID: 4847
64-bit integer IO format: %I64d Java class name: Main
Prev Submit Status Statistics Next
Type:
None

Tag it!

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
An article that Doge wants to know.
The size of the article does not exceed 64KB. The article contains only ASCII characters.
Output
Please output the number of word “doge” (case-insensitive). Refer to the samples for more details.
Sample Input
adoge
cutedo
yourge
blownDoge
lovelyDooge
Wow! Such Dooooooooooooooge!!!
D0ge
dOge DOGE
dogedoge
Sample Output
6
Source
2014西安全国邀请赛
题意: 给你文档找出所有doge
解: 直接kmp

#include<bits/stdc++.h>
using namespace std;
char st[10]="doge",s[99999];
int nxt[111],n,m;
void get()
{
    int i=0,j=-1;
    m=strlen(st);
    nxt[0]=-1;
    while(i<m)
    {
        if(j==-1||st[i]==st[j])
                nxt[++i]=++j;
        else j=nxt[j];
    }
}
int solve()
{
    int i=0,j=0,ans=0;
    while(i<n)
    {
        if(j==-1||s[i]==st[j])
            i++,j++;
        else
            j=nxt[j];
        if(j==m)
        {
            ans++,j=nxt[j];
        }
    }
    return ans;
}
int main()
{

   get();
   int sum=0;
   while(gets(s))
   {
       int i,j;
       n=strlen(s);
        for(i=0;i<n;i++)
        {
            if(s[i]>='A'&&s[i]<='Z')
                s[i]^=' ';
        }
        sum+=solve();
   }
   cout<<sum<<endl;
    return 0;
}
版权声明:

HDU 4847-Wow! Such Doge!(签到)

Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)...

HDU 4847 Wow! Such Doge! (注意输入格式!)

Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

2014西安邀请赛 (hdu4847-4856)

1001、          求给出的字符串中

HDU4847 Wow! Such Doge!

题目链接:HDU4847 Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/327...

HDU-4847-Wow! Such Doge!

ACM水题!

HDU 4847 Wow! Such Doge!

HDU 4847 Wow! Such Doge!Problem Description Chen, Adrian (November 7, 2013). “Doge Is An Ac- tual...

hdu 2087 剪花布条 kmp小水

剪花布条 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Sub...

LA 4847 binary search tree

平衡树上的动态规划
  • sdfzyhx
  • sdfzyhx
  • 2016年05月28日 10:52
  • 300

【HDU1686】Oulipo 思路+解题报告+代码+KMP算法个人理解 【0.5%达成】

HDU的题意就是,给你一个字符串A,一个字符串B,求A在B中总共出现了几次,注意,重复的也算。 比如说 str1 = "ABA" str2 = "ABABABA" 这样的话,那么str1就在s...

kmp算法(字符串匹配 next应用 hdu题目集合)

关于kmp算法的有关解释百度中有很多,可以自己查询更详细部分,其实最主要的就是next数组(以下题目我用的是on,因为hdu中直接用next变量或编译出错),当无法匹配时匹配字串跳转到前串中类似的位置...
  • M_GSir
  • M_GSir
  • 2016年08月20日 08:43
  • 288
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:hdu_4847_kmp_水
举报原因:
原因补充:

(最多只允许输入30个字)