time limit per test

2 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

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.

Input

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.

Output

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

Examples
Input
CODEWAITFORITFORCES
Output
YES
Input
BOTTOMCODER
Output
NO
Input
DECODEFORCES
Output
YES
Input
DOGEFORCES
Output
NO

题意就是条幅打错字母了,让你随便剪一次,剪去多余的字母,问你剩下的能否接成CODEFORCES的字样,要注意的是接的时候不可以改变顺序,只能剪一次!!!wa在没看清题意是剪一次。。。

一个很6的函数,直接就可以了。。。

substr函数用法举例:

substr('ABCDEFG', 0);     //返回:ABCDEFG,截取所有字符
substr('ABCDEFG', 2);     //返回:CDEFG,截取从C开始之后所有字符
substr('ABCDEFG', 0, 3); //返回:ABC,截取从A开始3个字符
substr('ABCDEFG', 0, 100); //返回:ABCDEFG,100虽然超出预处理的字符串最长度,但不会影响返回结果,系统按预处理字符串最大数量返回。
substr('ABCDEFG', -3); //返回:EFG,注意参数-3,为负值时表示从尾部开始算起,字符串排列位置不变

代码:

#include<bits/stdc++.h>
using namespace std;
int main(){
string str,str1;
int i,j;
cin>>str;
for(i=;i<str.size();i++){
for(j=i+;j<=str.size();j++){
str1=str.substr(,i)+str.substr(j);
if(str1=="CODEFORCES"){
printf("YES\n");
return ;
}
}
}
printf("NO\n");
return ;
}
 

Codeforces Round #300(Div. 2)-538A.str.substr 538B.不会 538C.不会 。。。的更多相关文章

  1. Codeforces Round #539 (Div. 2) - D. Sasha and One More Name(思维)

    Problem   Codeforces Round #539 (Div. 2) - D. Sasha and One More Name Time Limit: 1000 mSec Problem ...

  2. Codeforces Round #233 (Div. 2) B. Red and Blue Balls

    #include <iostream> #include <string> using namespace std; int main(){ int n; cin >&g ...

  3. Codeforces Round #367 (Div. 2) C. Hard problem(DP)

    Hard problem 题目链接: http://codeforces.com/contest/706/problem/C Description Vasiliy is fond of solvin ...

  4. Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)

    Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...

  5. Codeforces Round #277 (Div. 2) 题解

    Codeforces Round #277 (Div. 2) A. Calculating Function time limit per test 1 second memory limit per ...

  6. Codeforces Round #403 (Div. 2, based on Technocup 2017 Finals)

    Codeforces Round #403 (Div. 2, based on Technocup 2017 Finals) 说一点东西: 昨天晚上$9:05$开始太不好了,我在学校学校$9:40$放 ...

  7. Codeforces Round #491 (Div. 2)

    Codeforces Round #491 (Div. 2) https://codeforces.com/contest/991 A #include<bits/stdc++.h> us ...

  8. Codeforces Round #497 (Div. 2)

    Codeforces Round #497 (Div. 2) https://codeforces.com/contest/1008 A #include<bits/stdc++.h> u ...

  9. Codeforces Round #499 (Div. 2)

    Codeforces Round #499 (Div. 2) https://codeforces.com/contest/1011 A #include <bits/stdc++.h> ...

随机推荐

  1. 阿里云ECS升级OpenSSL记录

    1.下载OpenSSL wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz 2.解压编译安装 tar xf openssl-1.1.0e ...

  2. alias 命令详解

    alias 命令 作用:  设置命令别名,可以将较长的命令进行简化,使用alias 时,用户必须使用单引号将原来的命令引起来,防止特殊字符导致错误. 如要永久生效则将alias 命令存放到bash 的 ...

  3. UWP 应用通知Notifications

    之前说UWP 使用OneDrive云存储2.x api(二)[全网首发],微识别实现了上传下载的功能,那么为了给用户更上一层楼的体验,那就是在上传下载完成之后,弹出一通知Notifications. ...

  4. oracle自动备份_expdp_Linux

    [oracle@hbsjxtdb1 ~]$ crontab -e 0 4 * * * /backup/script/backupexpdp.sh [oracle@hbsjxtdb1 ~]$ cront ...

  5. eval基础,基础用法及解析json

    <body> <!-- eval 的使用:eval(string) 计算某个字符串,并执行其中的js代码 字符串上运用 eval() eval("x = 10;y = 2; ...

  6. 面向对象 初级版 (Preview) 未完

    概述: 面向过程:根据业务逻辑从上到下写垒代码 函数式:将某功能代码封装到函数里,日后使用无需重复编写,直接调用韩顺即可. 面向对象: 对函数进行分类和封装,让开发'更快更强' 面向对象和面向过程的通 ...

  7. python实现散列表的直接寻址法

    散列表(Hash table,也叫哈希表),是根据键(Key)而直接访问在内存存储位置的数据结构.也就是说,它通过计算一个关于键值的函数, 将所需查询的数据映射到表中一个位置来访问记录,这加快了查找速 ...

  8. sql优化原则与技巧

    加快sql查询是非常重要的技巧,简单来说加快sql查询的方式有以下几种:一.索引的引用 1.索引一般可以加速数据的检索速度,加速表与表之间的链接,提高性能,所以在对海量数据进行处理时,考虑到信息量比较 ...

  9. Robot Framework 学习笔记(二)-------第一个脚本

    robot Framework环境搭建好之后先来一个简单的脚本跑一下 一.新建项目 二.新建测试套件  三.创建测试用例 四.导入Selenium2Library库 因为RF框架编写基于web 的测试 ...

  10. 通过tokenPlease()函数获取accessToken

    作者:陈希章 发表于 2018年1月5日 这是一个很小的技巧,而且用几句话就能讲明白.事情是这样的,我最近在回顾之前写过的文章:通过其他第三方工具体验Microsoft Graph 的时候,发现最近的 ...