Accepted solution

1155B - Game with Telephone Numbers

Open original problem
Source code

#include<iostream>

using namespace std;

int main()

{

    int n,a=0,d=0;

    string s;

    cin>>n;

    cin>>s;

    int count=0;

    int p2=0;

   if (s.size()>=11)

    {

      for(int i=0;i<s.size()-10;i++)

      {

          if(s[i]=='8') count++;

      }

    }

    if(count>((n-11)/2))

    {

        cout<<"YES"<<endl;

    }

    else{

        cout<<"NO"<<endl;

    }

}
Join the discussion

Add your comment