-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathA_Football.cpp
51 lines (46 loc) · 1.14 KB
/
A_Football.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <bits/stdc++.h>
using namespace std;
//----------------------------------------------------------------//
// definitions //
#define endl '\n'
//----------------------------------------------------------------//
// preDefined functions//
//----------------------------------------------------------------//
//data types//
//----------------------------------------------------------------//
// helper functions //
//----------------------------------------------------------------//
// solve function//
void solve()
{
string str;cin>>str;
long long one=0 ,zero=0 ,flag=false;
for(auto&it:str){
if(zero>=7 or one>=7) flag=true;
if(it=='0'){
zero++;
one=0;
}
else{
one++;
zero=0;
}
}
if(zero>=7 or one>=7) flag=true;
if(flag)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
//----------------------------------------------------------------//
// main function//
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long test = 1;
// cin >> test;
while (test--)
{
solve();
}
}