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