Water problem codeforces Round #300 A Cutting Banner

Source: Internet
Author: User

Topic Portal

1 /*2 water problem: At the beginning of the wrong test instructions, thought is arbitrary cutting, DFS to do; The result was just a cut in the middle.3 determine if the remainder is "codeforces":)4 */5#include <cstdio>6#include <iostream>7#include <cstring>8#include <string>9#include <algorithm>Ten#include <cmath> One#include <Set> A#include <map> - using namespacestd; -  the Const intMAXN = 1e4 +Ten; - Const intINF =0x3f3f3f3f; - strings, tar ="Codeforces"; -  + intMainvoid)//codeforces Round #300 A cutting Banner - { +     //freopen ("a.in", "R", stdin); A  at      while(Cin >>s) -     { -         intLen_1 =s.length (); -         intLen_2 =tar.length (); -  -         if(Len_1 <Ten) puts ("NO"); in         Else -         { to             intp =0; +              for(; p<len_2; + +p) -             { the                 if(s[p]! = Tar[p]) Break; *             } $              for(; p<len_2; + +p)Panax Notoginseng             { -                 if(s[p+len_1-len_2]! = Tar[p]) Break; the             } +  A             if(p = = len_2) puts ("YES"); the             ElsePuts ("NO");  +         } -     } $  $     return 0; - } -  the /* - YESWuyi NO the */

Water problem codeforces Round #300 A Cutting Banner

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.