http://codeforces.com/contest/96

A

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define sqr(x) ((x)*(x))
 6 #define pb push_back
 7 #define eb emplace_back
 8 #define maxn 13000005
 9 #define eps 1e-8
10 #define pi acos(-1.0)
11 #define rep(k,i,j) for(int k=i;k<j;k++)
12 typedef long long ll;
13 typedef pair<int,int> pii;
14 typedef pair<char,int> pci;
15 typedef pair<pair<int,string>,pii> ppp;
16 typedef unsigned long long ull;
17 const long long MOD=1e9+7;
18 /*#ifndef ONLINE_JUDGE
19         freopen("1.txt","r",stdin);
20 #endif */
21 
22 
23 
24 int main(){
25     #ifndef ONLINE_JUDGE
26      //   freopen("1.txt","r",stdin);
27     #endif
28     std::ios::sync_with_stdio(false);
29     string str;
30     cin>>str;
31     int co=1;
32     vector<int>ve;
33     for(int i=1;i<str.length();i++){
34         if(str[i]!=str[i-1]){
35             ve.pb(co);
36             co=1;
37         }
38         else{
39             co++;
40         }
41     }
42     ve.pb(co);
43     for(int i=0;i<ve.size();i++){
44         if(ve[i]>=7) {cout<<"YES"<<endl;return 0;}
45     }
46     cout<<"NO"<<endl;
47 }
View Code

相关文章: