博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Beta Round #77 (Div. 2 Only) A. Football【字符串/判断是否存在连续7个0或7个1】...
阅读量:6969 次
发布时间:2019-06-27

本文共 1270 字,大约阅读时间需要 4 分钟。

A. Football
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Petya loves football very much. One day, as he was watching a football match, he was writing the players' current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If there are at least 7 players of some team standing one after another, then the situation is considered dangerous. For example, the situation 00100110111111101 is dangerous and11110111011101 is not. You are given the current situation. Determine whether it is dangerous or not.

Input

The first input line contains a non-empty string consisting of characters "0" and "1", which represents players. The length of the string does not exceed 100 characters. There's at least one player from each team present on the field.

Output

Print "YES" if the situation is dangerous. Otherwise, print "NO".

Examples
input
001001
output
NO
input
1000000001
output
YES 【代码】:
#include 
using namespace std;int cnt=1;int main (){ string a; cin>>a; for(int i=0;i

  

转载于:https://www.cnblogs.com/Roni-i/p/7989699.html

你可能感兴趣的文章
zepto和jquery的区别,zepto的不同使用8条小结
查看>>
sublime text 2安装及使用
查看>>
开源搜索引擎评估:lucene sphinx elasticsearch
查看>>
[转载]调整虚拟内存
查看>>
程序设计第二次作业<2>
查看>>
c++异常捕获
查看>>
Map集合中value()方法与keySet()、entrySet()区别 《转》
查看>>
c#读取xml文件配置文件Winform及WebForm-Demo具体解释
查看>>
ApiController使用Session验证出现Null解决方案
查看>>
【剑指offer】包括min函数的栈
查看>>
点云匹配和ICP算法概述
查看>>
ACdream 1083 有向无环图dp
查看>>
大众点评的实时计算
查看>>
Thrift反序列化导致OOM(转)
查看>>
【转载】谷歌酝酿将苹果Swift作为安卓APP主要开发语言
查看>>
自定义用户登录,会话保持,登录后自动跳转原页面
查看>>
Quartz的cronTrigger表达式
查看>>
李洪强经典iOS面试题11
查看>>
Ubuntu 14 常用“快捷键”,Ctrl + Alt + F1 进入终端,按 Ctrl + Alt + F7 回到界面
查看>>
知乎上关于游戏引擎的讨论
查看>>