Problem:


Score : 200 points

Problem Statement

Takahashi is competing in a sumo tournament.
The tournament lasts for 15 days, during which he performs in one match per day.
If he wins 8 or more matches, he can also participate in the next tournament.

The matches for the first k days have finished.
You are given the results of Takahashi's matches as a string S consisting of o and x.
If the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.

Print YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.

Constraints

1 \leq k \leq 15

S is a string of length k consisting of o and x.

Input

Input is given from Standard Input in the following format:

S

Output

Print YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.

Sample Input 1

oxoxoxoxoxoxox

Sample Output 1

YES

Takahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.

Sample Input 2

xxxxxxxx

Sample Output 2

NO



Sample input:
oxoxoxoxoxoxox


Sample output:
YES

Submission status: Runtime Error

Solution code:
S = list(input())
#勝利数
win = S.count("o")
#これから勝つ必要のある試合
korekara = 8 - win
#戦った試合
match = len(S)
#残り試合
nokori = 15 - match

if korekara <= 8:
    print("YES")
elif nokori => korekara:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
import numpy as np
from collections import defaultdict
from functools import reduce

import numpy as np
MOD = 1000000007

def mod_add(a, b):
  return (a+b)%MOD

def mod_sub(a, b):
  return (a+MOD-b)%MOD

def mod_mul(a, b):
  return (a*b)%MOD

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = (1,0,a)
    w = (0,1,b)
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    return w[0], w[1]

def mod_inv(a):
    x, _  = extgcd(a, MOD)
    return (MOD+x%MOD)%MOD

def mod_div(a, b):
    return a*mod_inv(b)%MOD

def mod_pow(a, b):
    res = 1
    while b > 0:
        if b & 1:
            res = res * a * MOD
        a = a * a % MOD
        b >>= 1
    return res

MAX = 200010

fac  = [1,1]
finv = [1,1]
inv  = [1,1]

def COMinit():
    # fac[0] = fac[1] = 1
    # finv[0] = finv[1] = 1
    # inv[1] = 1
    for i in range(2, MAX):
        fac.append(fac[i - 1] * i % MOD)
        inv.append(MOD - inv[MOD%i] * (MOD / i) % MOD)
        finv.append(finv[i - 1] * inv[i] % MOD)

def mod_COM(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;


# s = input()
# n = int(input())
COMinit()
N, A, B, C = list(map(int, input().split()))

a = mod_div(A, 100)
b = mod_div(B, 100)
c = mod_div(C, 100)

k_factor_memo = {}
def k_factor(M):
    if M in k_factor_memo:
        return k_factor_memo[M]
    if C == 100-C:
        res = fac[M+1]

        res = mod_div(res, mod_sub(1,c))
        k_factor_memo[M] = res
        return res
    res = mod_mul(fac[M], mod_div(c, mod_sub(1, mod_mul(2,c))))
    c2 = mod_div(c, mod_sub(1, c))
    c2 = pow(c2, M, MOD)
    c2 = mod_sub(c2, 1)
    res = mod_mul(res, c2)
    res = mod_div(res, mod_sub(1,c))
    k_factor_memo[M] = res
    return res

res = 0
an = pow(a, N, MOD)

for j in range(N):
    tmp = mod_mul(mod_mul(N, finv[N]), finv[j])
    # print(tmp)
    tmp = mod_mul(tmp, an)
    # print(tmp)
    tmp = mod_mul(tmp, pow(b, j, MOD))
    # print(tmp)
    tmp = mod_mul(tmp, k_factor(N+j))
    # print(tmp)
    res = mod_add(res, tmp)
# print(res)

bn = pow(b, N, MOD)
for j in range(N):
    tmp = mod_mul(mod_mul(N, finv[N]), finv[j])
    tmp = mod_mul(tmp, bn)
    tmp = mod_mul(tmp, pow(a, j, MOD))
    tmp = mod_mul(tmp, k_factor(N+j))
    res = mod_add(res, tmp)

print(res)

Submission status: Runtime Error

Solution code:
a = input()
x = [a[i:i+1] for i in range(len(a))]
r = len([s for s in l if s.endswith('x')])
if r >= 8:
	print('NO')
else:
	print('YES')

Submission status: Runtime Error

Solution code:
s = input()
n = s.count('x')
if x > 7:
    print('NO')
else:
    print('YES')

Submission status: Runtime Error

Solution code:
n = list(input())
length = n.len()

match = 0
count = 0
maxMatch = 15
maxCount = 8

for i in range(length):
  if(n[i] == 'o'):
    count++
    match++
  else :
    match++

if(count >= 8):
  print('NO')
else if(count < 8 && match < Maxmatch - match):
  print('YES')

Submission status: Runtime Error

Solution code:
n = list(input())
length = n.len()

count = 0
match = 0
max = 15
winMax = 8

for i in range(n):
  if(n[i] == 'x'):
  	match++
  else if(n[i] == 'o'):
    count++
  	match++
  if(max - match >= 7 && 8 - count > 0):
  	print('YES')
  else: 
  	print('NO')

Submission status: Runtime Error

Solution code:
x = input()
x_len = len(x)
count_w, count_l = 0,0
for i in range(len(x)):
  if x[i] == 'o':
    count_w += 1
  if x[i] == 'x':
    count_l += 1
    
if 15 - x_len + count_win >= 8:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
for i in string:
    sum_of_win = 1
    if i == 'o':
        sum_of_win += 1
    if i == 'x':
        sum_of_win -= 1
if sum_of_win >= 0:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
import numpy as np
s=np.asarray(list(str(input())))
r=15-s.size()
if(8 <= r + np.sum(s=="o")):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
s=input()

win=0
lose=0

for c in s:
  if c = "o":
    win+=1
  else:
    lose+=1

if win + ( 15 - ( win + lose ) ) > 8:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
    print('YES')

Submission status: Runtime Error

Solution code:
s = input()
count = 0

for i in range(len(s)):
    if s[i] = 'x':
        count += 1
if count >= 8:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
S = input()
r = 0
for s in S:
    if s == "x":
        r += 1
if r < 8:
    priant("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
S = str(input())

circles = 0
crosses = 0

for i in S:
    if S = 'o':
        circles += 1
    else:
        crosses += 1
if circles >= 8:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
S = input()
r = 0
for s in S:
    if s == "x":
        r += 1
if r < 8:
    priant("YES")
else:
    print("NO")

Submission status: Runtime Error

Solution code:
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=1
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
t=1
for tt in range(t):
    s=str(input())
    v=s.count('o')
    v+=15-len(s)
    if(v<8):
        print("NO")
    else:
        print("YES")
    #n,k,s= map(int, sys.stdin.readline().split(' '))
    #a=list(map(int,sys.stdin.readline().split(' ')))
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Submission status: Runtime Error

Solution code:
s=input();print("YNEOS"[15-len(s)+s.count("o")<8::2])'

Submission status: Runtime Error

Solution code:
s = raw_input()
valid = 0
left = 15 - len(s)
for tok in s:
    if tok == 'o':
        valid += 1
if valid + left >= 8:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
S=str(input())
N=S.count('o')
if N>=8:
    pint('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
cou
for i in range(len(S)):
  if S[i]=="o":
    cou += 1
K = 15-len(S)
if(K+cou>=8):
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
n = int(input())
lis = []
for i in range(n):
    s,p = list(input().split())
    lis.append([i+1,s,int(p)])
t = sorted(lis, key=lambda x: -x[2])
s = sorted(t, key=lambda x: x[1])


for i in s:
    print(i[0])