HDU5007 Post Robot, hdu5007postrobot

Source: Internet
Author: User

HDU5007 Post Robot, hdu5007postrobot

Question 1 of the ACM Xi'an network competition, water question...

#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;char s[10000];int main(){    //freopen("d:\\test.txt","r",stdin);    while(scanf("%s",s)!=EOF)    {        int len=strlen(s);        for(int i=0; i<len; i++)        {            if(i+5<len)            {                if(s[i]=='i'&&s[i+1]=='P'&&s[i+2]=='h'&&s[i+3]=='o'&&s[i+4]=='n'&&s[i+5]=='e') cout<<"MAI MAI MAI!"<<endl;            }            if(i+4<len)            {                if(s[i]=='A'&&s[i+1]=='p'&&s[i+2]=='p'&&s[i+3]=='l'&&s[i+4]=='e') cout<<"MAI MAI MAI!"<<endl;            }            if(i+3<len)            {                if(s[i]=='i'&&s[i+1]=='P'&&s[i+2]=='o'&&s[i+3]=='d') cout<<"MAI MAI MAI!"<<endl;                if(s[i]=='i'&&s[i+1]=='P'&&s[i+2]=='a'&&s[i+3]=='d') cout<<"MAI MAI MAI!"<<endl;                if(s[i]=='S'&&s[i+1]=='o'&&s[i+2]=='n'&&s[i+3]=='y') cout<<"SONY DAFA IS GOOD!"<<endl;            }        }    }    return 0;}



Php uses fsockopen post to access small I robots

Use curl ....

How Does SEO's robottxt file be written? How does it block some web pages that have already been included by SEO? If you don't understand them, you won't be given points.

If it is Google, the response is very fast; if it is Baidu, even if you add it, it may also be included, and the removal speed is also very slow, my couple seo blog is a good example.
• To intercept the entire website, use a forward slash.
Disallow:/• to intercept a directory and all its contents, add a forward slash after the directory name.
Disallow:/useless directory/• List a webpage to intercept it.
Disallow:/private file .html • to delete a specific image from a Google image, add the following content:
User-agent: Googlebot-Image
Disallow:/images/dog .jpg • to remove all images on your website from the Goo le image, run the following command:
User-agent: Googlebot-Image
Disallow:/• use the following content to intercept a specific file type (for example,. gif:
User-agent: Googlebot
Disallow:/*. gif $ • To prevent crawlers from capturing webpages on your website and displaying Adsense ads on these webpages, disable all roaming bots except Mediapartners-Google. In this way, the webpage cannot appear in the search results, and the Mediapartners-Google browser can analyze the webpage to determine the advertisement to be displayed. The Mediapartners-Google roaming bot does not share webpages with other Google User-agents. For example:
User-agent :*
Disallow :/

User-agent: Mediapartners-Google
Allow :/
Googlebot (but not all search engines) follows certain pattern matching principles.

• To match consecutive characters, use an asterisk (*). For example, to intercept access to all subdirectories starting with "private", use the following content:
User-agent: Googlebot
Disallow:/private */• block all question marks (?) (Specifically, this type of URL starts with your domain name, followed by any string, followed by a question mark, followed by any string), please use the following content:
User-agent: Googlebot
Disallow :/*? • To specify a match with the end character of a URL, use $. For example, to intercept all URLs ending with. xls, use the following content:
User-agent: Googlebot
Disallow:/*. xls $ you can use this pattern matching with the Allow command. For example, if? Represents a session ID, so you may want to exclude include? To ensure that Googlebot does not capture duplicate web pages. However? The ending URL may be the version of the webpage you want to include. In this case, you can perform the following settings on your robots.txt file:

User-agent :*
Allow :/*? $
Disallow :/*? Disallow :/*? The command will block the inclusion? (Specifically, it intercepts all URLs starting with your domain name, followed by any string, followed by question marks, and followed by any string ).

Allow :/*? $ The command will allow? Any URL Ending with your domain name (specifically, it will allow all URLs starting with your domain name, followed by any string, followed ?,? URL without any characters ).... Remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.