A. Cutting Banner

Time Limit: 1 Sec  Memory Limit: 256 MB

题目连接

http://codeforces.com/contest/538/problem/A

Description

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).

Sample Input

CODEWAITFORITFORCES

Sample Output

YES

HINT

题意

给你一个字符串,然后让你删除一段字符,看是否能构成CODEFORCES

题解:

啊,枚举区间就好了……

代码:

//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 200001
#define mod 10007
#define eps 1e-9
int Num;
char CH[20];
//const int inf=0x7fffffff;   //нчоч╢С
const int inf=0x3f3f3f3f;
/*inline void P(int x)
{Num=0;if(!x){putchar('0');puts("");return;}while(x>0)CH[++Num]=x%10,x/=10;while(Num)putchar(CH[Num--]+48);puts("");
}
*/
inline ll read()
{int x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;
}
inline void P(int x)
{Num=0;if(!x){putchar('0');puts("");return;}while(x>0)CH[++Num]=x%10,x/=10;while(Num)putchar(CH[Num--]+48);puts("");
}
//**************************************************************************************string s;
int a[maxn];
string kiss="CODEFORCES";
int main()
{cin>>s;for(int i=0;i<s.size();i++){for(int j=i+1;j<=s.size();j++){string p=s.substr(0,i)+s.substr(j);//cout<<p<<endl;if(p=="CODEFORCES"){cout<<"YES"<<endl;return 0;}}}cout<<"NO"<<endl;
}

转载于:https://www.cnblogs.com/qscqesze/p/4458882.html

Codeforces Round #300 A. Cutting Banner 水题相关推荐

  1. 贪心 Codeforces Round #300 A Cutting Banner

    题目传送门 1 /* 2 贪心水题:首先,最少的个数为n最大的一位数字mx,因为需要用1累加得到mx, 3 接下来mx次循环,若是0,输出0:若是1,输出1,s[j]--: 4 注意:之前的0的要忽略 ...

  2. Educational Codeforces Round 7 B. The Time 水题

    B. The Time 题目连接: http://www.codeforces.com/contest/622/problem/B Description You are given the curr ...

  3. Educational Codeforces Round 10 C. Foe Pairs 水题

    C. Foe Pairs 题目连接: http://www.codeforces.com/contest/652/problem/C Description You are given a permu ...

  4. Codeforces Round #701 (Div. 2)赛后补题报告(A~D)

    Codeforces Round #701 (Div. 2)赛后补题报告(A~D) A. Add and Divide 原题信息 http://codeforces.com/contest/1485/ ...

  5. 【CodeForces - 1A】Theatre Square(水题,几何)(CODEFORCES,梦的开始)

    题干: Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters ...

  6. Codeforces Round #727 (Div. 2) A~D题

    Codeforces提交链接 A题:Contest Start 题意: k组样例. 每行3个整数,n,x,t. n个人考试. 第1个人在 0 时刻开始考试, 第2个人在 x 时刻开始考试, 第3个人在 ...

  7. Codeforces Round #498 (Div. 3) - 赛后补题

    D. Two Strings Swaps PS:没思考清楚,重复算了一些情况. #include<bits/stdc++.h> #include<bitset> #define ...

  8. CodeForces - 1263A Sweet Problem(思维,水题)

    题目链接:点击查看 题目大意:给出三种颜色的糖果,分别表示为r,g,b,现在Tanya每天可以吃两个不同颜色的糖果,问最多可以吃多少天 题目分析:大水题一个,但自己真的蠢,一开始思路混乱,写了一大堆乱 ...

  9. C - Internet Address CodeForces - 245B(有些思维的水题)

    Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote ...

最新文章

  1. iPhone 12延期恐实锤:台积电5nm A14芯片将延期3个月
  2. python字符编码正确的是_python字符编码
  3. [ACM_数据结构] Color the ball [线段树水题][数组开大]
  4. 八种颠覆未来作战的前沿技术
  5. 时间序列数据挖掘综述
  6. vm安装windows出问题:加载驱动程序 缺少计算机所需的介质驱动程序。这可能是DVD,U盘或者硬盘驱动程序如果你有包含该驱动程序的CD,DVD或U盘,请立即插入 注意:如果windows安装介..
  7. H5页面在微信中下载APP的解决办法
  8. 海外 Android 三方应用市场
  9. 2022年找工作!我建了一个AI算法岗求职群
  10. SQLServer数据库基础(笔记)
  11. iOS-常见三种加密(MD5、非对称加密,对称加密)
  12. educoder实训平台python基础综合测试答案_智慧职教mooc2020Python程序设计基础章节测试答案...
  13. attachment_fu 已是昨日黄花,今朝请用paperclip
  14. 接口设计中,如何封装对json格式的数据签名
  15. addRoute动态添加路由导致浏览器警告
  16. urx驱动ur3和onrobot rg2
  17. 10英文图片网站 值得你收藏
  18. Java创建柱状图及饼状图
  19. StringBoot + Thymeleaf + PageHelper + PageInfo 前端引入式分页
  20. 虚幻4基础物理设置,和碰撞检测

热门文章

  1. 贪心算法单源点最短路径例题c语言源代码,Dijkstra算法是解单源最短路径问题的一个贪心算法...
  2. java添加窗体_添加的窗体
  3. python支持保护类型_day14总结-内置类属性、私有化、保护及继承
  4. c++数据结构队列栈尸体_一本正经的聊数据结构(3):栈和队列
  5. mvc模型中MySQL类_Mvc5 EF6 CodeFirst Mysql (二) 修改数据模型
  6. mybatis参数有list和实体类_Mybatis的几种传参方式,你了解吗?
  7. java phantomjs 2.1.1_Java之网络爬虫WebCollector2.1.2+selenium2.44+phantomjs2.1.1
  8. javascript的Math对象和全局函数
  9. C++:多线程中的小白(2)线程启动、结束、创建线程、join、detach
  10. 基于YOLO的目标检测界面化部署实现(支持yolov1-yolov5、yolop、yolox)