Codeforces Beta Round #77 (Div. 2 Only), problem: (A) Football:
http://codeforces.com/problemset/problem/96/A
Codeforces Beta Round #77 (Div. 2 Only), problem: (A) Football solution: http://ideone.com/27pT88
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main() {
int flag, cnt;
char s[105];
scanf("%s", s);
cnt=flag=0;
for(int i=1; i<strlen(s); i++) {
if(s[i]==s[i-1]) cnt++;
else cnt=0;
if(cnt==6) {
flag=1;
printf("YES");
break;
}
}
if(flag==0) printf("NO");
return 0;
}
No comments:
Post a Comment