CF538A.Cutting Banner

普及/提高-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforcesω that takes place on the Miami beach. Unfortunately, the company that made the banner mixed up two orders and delivered somebody else's banner that contains someone else's word. The word on the banner consists only of upper-case English letters.

There is very little time to correct the mistake. All that we can manage to do is to cut out some substring from the banner, i.e. several consecutive letters. After that all the resulting parts of the banner will be glued into a single piece (if the beginning or the end of the original banner was cut out, only one part remains); it is not allowed change the relative order of parts of the banner (i.e. after a substring is cut, several first and last letters are left, it is allowed only to glue the last letters to the right of the first letters). Thus, for example, for example, you can cut a substring out from string 'TEMPLATE' and get string 'TEMPLE' (if you cut out string AT), 'PLATE' (if you cut out TEM), 'T' (if you cut out EMPLATE), etc.

Help the organizers of the round determine whether it is possible to cut out of the banner some substring in such a way that the remaining parts formed word CODEFORCES.

为在迈阿密海滩举行的 Codeforcesω 第 1000 场线下赛,组委会订购了一幅印有单词 CODEFORCES 的大型横幅。不幸的是,制作横幅的公司搞错了订单,送来了另一幅印有其他单词的横幅。该横幅上的单词仅由大写英文字母组成。

纠正错误的时间非常有限。我们唯一能做的,是从横幅中剪下某个子串(即若干连续的字母)。剪下后,横幅剩余的部分将被粘合为一个整体(若剪去了原横幅的开头或结尾,则仅剩一个部分);不允许改变横幅各部分之间的相对顺序(即:若剪去某子串后,原横幅剩下开头若干字母和结尾若干字母,则只允许将结尾部分粘贴到开头部分的右侧)。例如,对字符串 TEMPLATE,可剪去某个子串得到 TEMPLE(剪去 AT)、PLATE(剪去 TEM)、T(剪去 EMPLATE)等。

请帮助本次比赛的组织者判断:能否从当前横幅中剪去某个子串,使得剩余部分拼接后恰好形成单词 CODEFORCES。

输入格式

The single line of the input contains the word written on the banner. The word only consists of upper-case English letters. The word is non-empty and its length doesn't exceed 100 characters. It is guaranteed that the word isn't word CODEFORCES.

输入仅包含一行,即横幅上所写的单词。该单词仅由大写英文字母组成。单词非空,且长度不超过 100 个字符。保证该单词不是 CODEFORCES。

输出格式

Print 'YES', if there exists a way to cut out the substring, and 'NO' otherwise (without the quotes).

如果存在一种方式可以截取出该子字符串,则输出 YES,否则输出 NO(不带引号)。

输入输出样例

  • 输入#1

    CODEWAITFORITFORCES

    输出#1

    YES
  • 输入#2

    BOTTOMCODER

    输出#2

    NO
  • 输入#3

    DECODEFORCES

    输出#3

    YES
  • 输入#4

    DOGEFORCES

    输出#4

    NO

输入解题思路,AI测评打分。不知道怎么写?

首页