Advertisement
Niloy007

A Football Codeforces

Apr 1st, 2020
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     string n;
  6.     int a = 0, b = 0;
  7.  
  8.     getline(cin, n);
  9.  
  10.     for(int i = 0; i< n.length(); i++) {
  11.         if(n[i] == '0') {
  12.             a++;
  13.             if(b < 7)
  14.                 b = 0;
  15.         } else {
  16.             b++;
  17.             if(a < 7)
  18.                 a = 0;
  19.         }
  20.     }
  21.     if(a >= 7 || b >= 7) {
  22.         cout << "YES\n";
  23.     } else {
  24.         cout << "NO\n";
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement