Problem description

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 and 11110111011101 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 100characters. 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
解题思路:简单处理字符串,如果有连续相同的数字不小于7个,则输出"YES",否则输出"NO"。
AC代码:
 #include <bits/stdc++.h>
using namespace std;
int main()
{
char a[];int cnt=,i=;bool flag=false;
cin>>a;
while(a[i]!='\0'){
if(a[i]==''){while(a[i]==''){cnt++;i++;}}
else{while(a[i]==''){cnt++;i++;}}
if(cnt>=){flag=true;break;}
cnt=;
}
if(flag)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return ;
}

C - Football的更多相关文章

  1. POJ 3071 Football

    很久以前就见过的...最基本的概率DP...除法配合位运算可以很容易的判断下一场要和谁比.    from——Dinic算法                         Football Time ...

  2. Football Foundation (FOFO) TOJ 2556

    The football foundation (FOFO) has been researching on soccer; they created a set of sensors to desc ...

  3. 17111 Football team

    时间限制:1000MS  内存限制:65535K 提交次数:0 通过次数:0 题型: 编程题   语言: C++;C Description As every one known, a footbal ...

  4. CodeForces 432B Football Kit

     Football Kit Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Subm ...

  5. Football(POJ3071)

    Football Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3469   Accepted: 1782 Descript ...

  6. 16年大连网络赛 1006 Football Games

    题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?cid=725&pid=1006 Football Games Time ...

  7. 三分--Football Goal(面积最大)

    B - Football Goal Time Limit:500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Su ...

  8. HDU5873:Football Games

    题目链接: Football Games 分析: 先将分数排序,然后 设当前队编号为p,设个指针为p+1,然后p>1,每次p-=2,指针右移一位p==1,指针指向的队-=1p==0,从指针开始到 ...

  9. Codeforces Gym 100425H H - Football Bets 构造

    H - Football BetsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  10. Football

    Football Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2882   Accepted: 1466 Descript ...

随机推荐

  1. JS数组reduce()方法

    1.语法 arr.reduce(callback,[initialValue]) reduce 为数组中的每一个元素依次执行回调函数,不包括数组中被删除或从未被赋值的元素,接受四个参数:初始值(或者上 ...

  2. Django - 创建多对多及增加示例

    创建多对多: 方式一: 自定义关系表 备注:自定义表Host.Application,通过自定义表,将表Host和Application进行关联(通过外键方式工): 执行语句:python manag ...

  3. 破解js中的this指向

    首先必须要说的是,this的指向在函数定义的时候是确定不了的,只有函数执行的时候才能确定this到底指向谁,实际上this的最终指向的是那个调用它的对象(这句话有些问题,后面会解释为什么会有问题,虽然 ...

  4. 实验十二 团队作业8:软件测试与Alpha冲刺 第三天

    项目 内容 这个作业属于哪个课程 老师链接 这个作业的要求在哪里 作业链接地址 团队名称 always run 作业学习目标 (1)掌握软件测试基础技术.(2)学习迭代式增量软件开发过程(Scrum) ...

  5. LINUX 查看硬件配置命令

      系统 # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinfo # 查看CPU信息 # ...

  6. Mysql双主自增长冲突处理

    Mysql双主自增长冲突处理   多主互备和主从复制有一些区别,因为多主中都可以对服务器有写权限,所以设计到自增长重复问题   出现的问题(多主自增长ID重复)  1:首先我们通过A,B的test表结 ...

  7. 相同的雪花 Hash

    相同的雪花 时间限制:1000 ms  |  内存限制:65535 KB 难度:4   描述 You may have heard that no two snowflakes are alike. ...

  8. B - Oulipo

    The French author Georges Perec (1936�C1982) once wrote a book, La disparition, without the letter ' ...

  9. eclipse上导入import git项目

    1.左上角File->import->git eclipse 可以从很多来源处import项目,项目来源可以使git/maven/general等. import来源可以看下面 2.点击g ...

  10. [MongoDB]Python 操作 MongoDB

    from pymongo import MongoClient mc = MongoClient('localhost',27017) db = mc.users db.users.save({'na ...