Niloy007

A Football Codeforces

Apr 1st, 2020
158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data