contest: Codeforces Round #300, problem: (A) Cutting Banner
来源:互联网 发布:java基础入门培训学校 编辑:程序博客网 时间:2024/04/30 03:06
看了这篇博客的提示又写了第三份代码 = =
http://www.cnblogs.com/mjy0724/p/4463816.html
31ms
#include<iostream>#include<cstring>#include<cstdio>using namespace std;char s[100+10];int main(){ char des[11]="CODEFORCES"; while(~scanf("%s",s)) { int len=strlen(s); if(len<10) { printf("NO\n");continue; } int cnt1=0,cnt2=9; for(int i=0;i<=10;i++) { /// memcpy(str,s,i); /// memcpy(str+i,s+i+len-10,10-i); if(s[i]==des[cnt1]) cnt1++; else break; } for(int i=len-1;i>=len-10;i--) { if(s[i]==des[cnt2]) cnt2--; else break; } if(cnt1+9-cnt2>=10) printf("YES\n"); else printf("NO\n"); } return 0;}
0 0
- contest: Codeforces Round #300, problem: (A) Cutting Banner
- contest: Codeforces Round #300, problem: (A) Cutting Banner
- codeforces #300 A. Cutting Banner
- codeforces A. Cutting Banner
- codeforces 538 A.Cutting Banner
- codeforces 538 A Cutting Banner
- Codeforces Round #300-Cutting Banner(substr函数的应用)
- 第一次打CODEFORCES-----A. Cutting Banner
- contest: Codeforces Round #301 (Div. 2), problem: (A) Combination Lock
- contest: Codeforces Round #303 (Div. 2), problem: (A) Toy Cars
- #300 (div.1 2) A. Cutting Banner
- 538A - Cutting Banner
- A. Cutting Banner
- contest: Codeforces Round #307 (Div. 2), problem: (A) GukiZ and Contest
- codeforces/contest/797/problem/A
- contest: Codeforces Round #300, problem: (B) Quasi Binary
- Educational Codeforces Round 22 A. The Contest
- http://codeforces.com/contest/6/problem/A
- contest: Codeforces Round #300, problem: (A) Cutting Banner
- jNetPcap-用Java实现libpcap完整封装的网络数据包捕获函数库
- 张歆艺袁弘同居被拍喂食亲吻 疑似恋情曝光
- u-boot的异常向量表,s5pv210的启动机制原理
- Leetcode NO.87 Scramble String
- contest: Codeforces Round #300, problem: (A) Cutting Banner
- 没有return关键字的main()函数返回值
- 没有错和对是两个概念
- 美国J1签证相关
- LeetCode 题解(91): Shortest Palindrome
- contest: Codeforces Round #300, problem: (B) Quasi Binary
- 无线应用安全剖析-sanr
- leetcode 214: Shortest Palindrome
- Netty+Spring