codeforces水题100道 第二十三题 Codeforces Beta Round #77 (Div. 2 Only) A. Football (strings)
题目链接:http://www.codeforces.com/problemset/problem/96/A
题意:判断一个0-1字符串中出现的最长的0字串或者1字串的长度是否大于等于7。
C++代码:
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
string s;
int tmp = ;
bool chk()
{
int len = s.length();
for (int i = ; i < len; i ++)
if (s[i] == s[i-])
{
tmp ++;
if (tmp >= )
return true;
}
else
tmp = ;
return false;
}
int main()
{
cin >> s;
puts(chk() ? "YES" : "NO");
return ;
}
C++
codeforces水题100道 第二十三题 Codeforces Beta Round #77 (Div. 2 Only) A. Football (strings)的更多相关文章
- codeforces水题100道 第二十七题 Codeforces Round #172 (Div. 2) A. Word Capitalization (strings)
题目链接:http://www.codeforces.com/problemset/problem/281/A题意:将一个英文字母的首字母变成大写,然后输出.C++代码: #include <c ...
- codeforces水题100道 第二十一题 Codeforces Beta Round #65 (Div. 2) A. Way Too Long Words (strings)
题目链接:http://www.codeforces.com/problemset/problem/71/A题意:将长字符串改成简写格式.C++代码: #include <string> ...
- codeforces水题100道 第二十题 Codeforces Round #191 (Div. 2) A. Flipping Game (brute force)
题目链接:http://www.codeforces.com/problemset/problem/327/A题意:你现在有n张牌,这些派一面是0,另一面是1.编号从1到n,你需要翻转[i,j]区间的 ...
- codeforces水题100道 第十三题 Codeforces Round #166 (Div. 2) A. Beautiful Year (brute force)
题目链接:http://www.codeforces.com/problemset/problem/271/A题意:给你一个四位数,求比这个数大的最小的满足四个位的数字不同的四位数.C++代码: #i ...
- Codeforces Beta Round #77 (Div. 2 Only) A. Football【字符串/判断是否存在连续7个0或7个1】
A. Football time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...
- Codeforces Beta Round #77 (Div. 2 Only)
Codeforces Beta Round #77 (Div. 2 Only) http://codeforces.com/contest/96 A #include<bits/stdc++.h ...
- codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)
题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...
- codeforces水题100道 第二十五题 Codeforces Round #197 A. Helpful Maths (Div. 2) (strings)
题目链接:http://www.codeforces.com/problemset/problem/339/A题意:重新组合加法字符串,使得按照1,2,3的顺序进行排列.C++代码: #include ...
- codeforces水题100道 第二十四题 Codeforces Beta Round #85 (Div. 2 Only) A. Petya and Strings (strings)
题目链接:http://www.codeforces.com/problemset/problem/112/A题意:忽略大小写,比较两个字符串字典序大小.C++代码: #include <cst ...
随机推荐
- 完全图解RNN、RNN变体、Seq2Seq、Attention机制
完全图解RNN.RNN变体.Seq2Seq.Attention机制 本文主要是利用图片的形式,详细地介绍了经典的RNN.RNN几个重要变体,以及Seq2Seq模型.Attention机制.希望这篇文章 ...
- (笔记)CanOpen协议【CanFestival】移植方法 支持VC、QT、STM32
转自http://bbs.21ic.com/icview-878522-1-1.html 前段时间学习了CanOpen协议,到网上下载的CanFestival3-10源码,移植到VC.QT.STM ...
- e816. 创建工具栏
A toolbar can be either horizontal or vertical. When the orientation is horizontal, the objects in t ...
- ZooKeeper系列之二:Zookeeper常用命令
https://my.oschina.net/u/347386/blog/313037
- om.ibm.ws.jsp.translator.JspTranslationException:JSPG0227E解决办法
原文链接:http://blog.163.com/rambosir@126/blog/static/124116406201212834417/ 今天在完成功能后,将jsp页面部署至websphere ...
- [原创]Allegro 导入DXF文件,保留布好的线路信息
最近智能钥匙产品开发过程中,由于结构装配尺寸的偏差,需要对电路PCB外框OUTLINE进行缩小调整,并且USB插座定位孔改变. Allegro软件在线性绘制方面是有严重缺陷的,想绘制一个异形的板框比较 ...
- Linux入门基础教程之Linux系统简介
Linux的历史: Multics项目开发不顺利,贝尔实验室退出该项目后,开发了Unix,商业化后价格昂贵.Dennis Ritchie和Ken Thompson开发了Unix内核以及C语言.Andr ...
- MYSQL之You can't specify target table for update in FROM clause解决办法
mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...
- Mac下给SD卡烧录树莓派系统
1.mac 磁盘工具 抹掉sd卡 为fat 2. df -h 看清sd卡号 3. 卸载sd卡 diskutil unmount /dev/disk2s2 Volume UNTITLED on disk ...
- 安装vmware vCenter Appliance
vcenter appliance是一个vmware配置好的基于suse系统的vcenter的all in one式的虚拟机,比安装基于windows的vcenter服务省事多了,所以我选择部署vCe ...