Problem:


Score : 100 points

Problem Statement

A Hitachi string is a concatenation of one or more copies of the string hi.

For example, hi and hihi are Hitachi strings, while ha and hii are not.

Given a string S, determine whether S is a Hitachi string.

Constraints

The length of S is between 1 and 10 (inclusive).

S is a string consisting of lowercase English letters.

Input

Input is given from Standard Input in the following format:

S

Output

If S is a Hitachi string, print Yes; otherwise, print No.

Sample Input 1

hihi

Sample Output 1

Yes

hihi is the concatenation of two copies of hi, so it is a Hitachi string.

Sample Input 2

hi

Sample Output 2

Yes

Sample Input 3

ha

Sample Output 3

No



Sample input:
hihi


Sample output:
Yes

Submission status: Accepted

Solution code:
s=input()
if len(s)%2:
    print('No')
    exit()
for i in range(0,len(s),2):
    if i > len(s):
        break
    if s[i] != 'h' or s[i+1]!='i':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
s = input()

if(len(s)%2 == 1):
    print('No')
    exit()

for i in range(len(s)//2):
    if(s[2*i:2*i+2] != 'hi'):
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    if s in ['hi','hihi','hihihi','hihihihi','hihihihihi']:
            print('Yes')
    else:
            print('No')
resolve()

Submission status: Accepted

Solution code:
S = input().replace('hi','')
if len(S) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
List1= []
List2 = []
n1 = 0
n2 = 0
for i in range(0,len(S),2):
  List1.append(S[i])
for i in range(1,len(S),2):
  List2.append(S[i])
n1 = List1.count("h")
n2 = List2.count("i")
if n1 == len(List1) and n2 == len(List2) and n1 == n2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s=input()
    if len(s)%2==0:
        if s=='hi'*(len(s)//2):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    s=str(input())
    ls=len(s)
    if ls%2==1:
        print('No')
    else:
        if s=='hi'*(ls//2):
            print('Yes')
        else:
            print('No')


resolve()

Submission status: Accepted

Solution code:
data =["hi","hihi","hihihi","hihihihi","hihihihihi"]
line = input()
if line in data:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()

if len(s.replace('hi', '')) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input().split("hi")
S = filter(lambda x: x != "", S)
print("Yes" if not tuple(S) else "No")

Submission status: Accepted

Solution code:
S = input()
if len(S) %2 == 1:
  print("No")
  exit()
for i in range(len(S)):
  if S[i] != "hi"[i%2]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
# python3.4.2用
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def lprint(l): print(*l, sep='\n')

S = input()

for i in range(0,len(S),2):
    if S[i:i+2] != 'hi':
        print('No')
        break
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
n = len(s) // 2
print('Yes' if s == 'hi' * n else 'No')

Submission status: Accepted

Solution code:
S=input()
flg = True
for i in range(len(S)):
    if len(S)%2 == 1:
        flg = False
        break
    if i%2==0:
        if S[i]+S[i+1] != "hi":
            flg = False

if flg == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input().replace("hi","")
if S == "":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input().replace("hi","")
if len(s)==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

hi = S.replace('hi', '')

if hi == "":
   print("Yes")
else:
   print("No")

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from itertools import combinations # (string,3) 3回
#from collections import deque
#import collections.defaultdict(list)
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    s = input()
    for i in range(0,len(s),2):
        #print(s[i:i+2])
        if s[i:i+2] == 'hi':
            pass
        else:
            print('No')
            exit()
    print('Yes')
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
s = input()
s = s.replace("hi", "")
if s:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = readline().rstrip().decode()
if len(s) % 2 == 1:
    print('No')
    exit()
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] != 'h':
            print('No')
            exit()
    else:
        if s[i] != 'i':
            print('No')
            exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()
n = len(S)
result = "Yes"
if n%2 :
    result = "No"
else:
    for i in range(n):
        if i % 2 == 0 and S[i] == "h":
            i = i +1
        elif i % 2 and S[i] == "i":
            i = i + 1
        else:
            result = "No"
            break
print(result)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from sys import stdin, stderr

def main():
   S = stdin.readline().strip()
   if (len(S) % 2) != 0:
      print('No')
      return 0
   for i in xrange(0, len(S), 2):
      if S[i:i+2] != 'hi':
         print('No')
         return 0
   print('Yes')

   return 0

if __name__ == '__main__': main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
for i in range(1, 6):
  if "hi"*i == S:
    print("Yes")
    break
else:
  print("No")

Submission status: Accepted

Solution code:
s=input()
if s=='hi' or s=='hihi' or s=='hihihi' or s=='hihihihi' or s=='hihihihihi':
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S =input()
if len(S) % 2 != 0:
    print('No')
    exit()
for i in range(0,len(S),2):
    if S[i:i+2] != 'hi':
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()
if S.replace("hi", "") == "":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

ans = 'Yes'
while S:
    if S.startswith('hi'):
        S = S[2:]
    else:
        ans = 'No'
        break

print(ans)

Submission status: Accepted

Solution code:

s=input()
if len(s)%2!=0:

    print("No")
else:
    bool=False
    for i in range(len(s)):
        if i%2==0:
            if s[i]!="h":

                print("No")
                bool=True
                break
        else:
            if s[i]!="i":
                print("No")

                bool=True
                break
    if bool is False:
        print("Yes")

Submission status: Accepted

Solution code:
s = input()
if s == 'hi' * (len(s) // 2):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
print("Yes" if 2 * S.count("hi") == len(S) else "No")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    s=input()
    if len(s)%2==1:
        print("No")
        sys.exit()
    for i in range(len(s)//2):
        if s[2*i:2*i+2]!="hi":
            print("No")
            break
    else:print("Yes")

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
S = str(input())
S_size = len(S)
hi_size = S.count('hi')
if S_size == hi_size * 2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
for i in range(6):
	if s == "hi" *i:
		print("Yes")
		exit()
print("No")

Submission status: Accepted

Solution code:
s = input()
cnt = 0
for i in range(len(s)):
  if i % 2 == 0 and s[i] == 'h':
    cnt += 1
  elif i % 2 == 1 and s[i] == 'i':
    cnt += 1
if len(s) % 2 == 0 and cnt == len(s):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

for i in range(1, 6):
    if 'hi' * i == S:
        print('Yes')
        exit()

print('No')

Submission status: Accepted

Solution code:
S=input()
for i in range(6):
	if S=="hi" *i:
		print("Yes")
		exit()
print("No")

Submission status: Accepted

Solution code:
class Solution(object):
	def is_hitachi_string(self, string):

		if len(string) == 0:
			print 'No'
			return

		hi_str = 'hi'
		hi_idx = 0
		for idx in xrange(len(string)):
			if idx > 9:
				print 'No'
				return

			if string[idx] != hi_str[hi_idx]:
				print 'No'
				return

			hi_idx = (hi_idx + 1) % 2

		if hi_idx == 0:
			print 'Yes'
		else:
			print 'No'

if __name__ == '__main__':
	sol = Solution()
	string = raw_input()
	sol.is_hitachi_string(string)

Submission status: Accepted

Solution code:
s=input()
leng=len(s)
if (leng%2==1):
  print("No")
else:
  check="hi"*(leng//2)
  if (s==check):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
from sys import stdin
S = stdin.readline().rstrip()
pattern = ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']
if S in pattern:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=input()
for i in range(6):
	if s=="hi" *i:
		print("Yes")
		exit()
print("No")

Submission status: Accepted

Solution code:
S=input()
if 'hi'==S or 'hihi'==S or 'hihihi'==S or 'hihihihi'==S or 'hihihihihi'==S :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())

a = 0
b = 0
c = 0

for i in range(len(s)):
  if i%2 == 0 and s[i] == "h":
    a += 1
  elif i%2 == 1 and s[i] == "i":
    b += 1
  else:
    c += 1
    
if a == b and c == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
S = input()
for i in range(1,6):
    if S == "hi" * i:
        print("Yes")
        sys.exit()
print("No")

Submission status: Accepted

Solution code:
r = input()
if len(r) & 1:
    print("No")

else:
    for i in range(0, len(r), 2):
        if not (r[i] == 'h' and r[i + 1]=='i'):
            print("No")
            exit()
    print("Yes")

Submission status: Accepted

Solution code:
if len(input().replace('hi', '')) > 0:
	print('No')
else:
	print('Yes')

Submission status: Accepted

Solution code:
#1st: Code Festival 2015 Qualifying B (0408)
if False:
    N,M=map(int,input().split())
    A=[int(i) for i in input().split()]
    B=[int(i) for i in input().split()]
    A.sort()
    B.sort()
    ans='YES'
    if N<M:
        ans='NO'
    else:
        while B:
            a=A.pop()
            b=B.pop()
            if b>a:
                ans='NO'
                break
    print(ans)

#2nd: CF2014QA-C
if False:
    A,B=map(int,input().split())
    def uruu(n):
        ret=0
        ret+=n//4
        ret-=n//100
        ret+=n//400
        return ret
    print(uruu(B)-uruu(A-1))

#3rd: Code Formula 2014 - C
if False:
    S=input()
    stack=list(S[::-1])
    # print(stack)
    user=[]
    s=stack.pop()
    while stack:
        # print(s)
        if s=="@":
            tmp=''
            x=stack.pop()
            while not(x in ('@',' ')):
                # print(x)
                tmp+=x
                if not stack:
                    break
                x=stack.pop()
            user.append(tmp)
            s=x
        else:
            s=stack.pop()
    user=list(set(user))
    user.sort()
    for u in user:
        if u:
            print(u)

#4th: Hitachi Programming Contest 2020 - A    
if True: 
    S=input()
    hi=['hi'*i for i in range(1,10)]
    print('Yes' if S in hi else 'No')

Submission status: Accepted

Solution code:
S=input()
 
print('Yes' if S.replace('hi','')=='' else 'No')

Submission status: Accepted

Solution code:
z = input()

if z=='hi' or z=='hihi' or z=='hihihi' or z=='hihihihi' or z=='hihihihihi':
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
flg = True
if len(S)%2 == 1:
  print('No')
else:
  for i in range(0, len(S), 2):
    if S[i:i+2] != 'hi':
      print('No')
      flg = False
      break
  if flg:
    print('Yes')

Submission status: Accepted

Solution code:
def main():
    s = input()
    ok = False
    hi = ""
    for _ in range(5):
        hi += "hi"
        if s == hi:
            ok = True
    if ok:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
z = input()

if z=='hi' or z=='hihi' or z=='hihihi' or z=='hihihihi' or z=='hihihihihi':
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
str = input()
def hitachi(S):
    hitachi_str = [True if S[i:i+2] == 'hi' else False for i in range(0,len(S),2)]
    if all(hitachi_str):
        result = 'Yes'
    else:
        result = 'No'
    return result
print(hitachi(str))

Submission status: Accepted

Solution code:
# 日立製作所 社会システム事業部 プログラミングコンテスト2020: A – Hitachi String
print('Yes' if input().replace('hi', '') == '' else 'No')

Submission status: Accepted

Solution code:
print('Yes' if input() in ['hi'*i for i in range(1,6)] else 'No')

Submission status: Accepted

Solution code:
li = list(input())
n = len(li)
for i in range(0, n, 2):
    if li[i] == 'h' and li[i + 1] == 'i' and n % 2 == 0:
        pass
    else:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
x='hi'
y=[]
for i in range(1,6):
  y.append(x*i)
if input() in y:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
#############################################
s=input()
ans="Yes"
for a in range(0,len(s),2):
  if len(s)-1==a or (not s[a:a+2]=="hi"):
  	ans="No"
print(ans)

Submission status: Accepted

Solution code:
''' ===========================================
from collections import deque
    appendleft() = push_front(), append = push_back()
    popfleft() = pop_front(), pop() = pop_back()
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
=========================================== '''
##======================================python3
import sys
import collections
input = sys.stdin.readline().rstrip
from sys import stdin #read(), readline()
sys.setrecursionlimit(10**6)
INF = 1<<50
MINI = 100005

class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()

Submission status: Accepted

Solution code:
''' ===========================================
from collections import deque
    appendleft() = push_front(), append = push_back()
    popfleft() = pop_front(), pop() = pop_back()
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
=========================================== '''
##======================================python3
import sys
import collections
from sys import stdin #read(), readline()
sys.setrecursionlimit(10**6)
INF = 1<<50
MINI = 100005

class gv:
    input = None;
    
def build():
    gv.str = stdin.readline().rstrip()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()

Submission status: Accepted

Solution code:
''' ===========================================
from collections import deque
    appendleft() = push_front(), append = push_back()
    popfleft() = pop_front(), pop() = pop_back()
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
=========================================== '''
##======================================python3
import sys
import collections
from sys import stdin #read(), readline()

sys.setrecursionlimit(10**6)
INF = 1<<50
MINI = 100005

class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()

Submission status: Accepted

Solution code:

class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()

Submission status: Accepted

Solution code:
class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

build()
solve()

Submission status: Accepted

Solution code:
import re

def judge(check_string):

    # check length.
    if not((1 <= len(check_string)) and (len(check_string) <= 10)):
        print("No")

    # check character.
    allow_pattern = "[a-z]+"
    group = re.match(allow_pattern, check_string)

    HITACH_STRING = "^(hi){1,}$"

    if(re.match(HITACH_STRING, check_string)):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    hitachi_string = input()
    judge(hitachi_string)

Submission status: Accepted

Solution code:
import sys

s = input()
for _ in range(5):
    if len(s) == 1:
        print('No')
        sys.exit()
    if len(s) == 0:
        print('Yes')
        sys.exit()
    if s[:2] == 'hi':
        s = s[2:]
    else:
        print('No')
        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
a=input()
# a="hihihsi"
for i in range(0,len(a),2):
    if a[i:i+2]=="hi":
        continue
    else:
        print("No")
        break
else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
while s[0:2:] == "hi":
    s = s[2::]
if len(s) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
hi = []

for i in range(5):
    hi.append("hi"*(i+1))

print("Yes" if S in hi else "No")

Submission status: Accepted

Solution code:
## coding: UTF-8


S = input()

if(S == 'hi' or S == 'hihi' or S == 'hihihi' or S == 'hihihihi' or S == 'hihihihihi'):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    s = input()
    s = s.replace("hi","")

    if s =="":
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
words = ['hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi']
print('Yes' if input() in words else 'No')

Submission status: Accepted

Solution code:
s=input()
for i in range(len(s)):
    if s=="hi"*i:
        print("Yes")
        exit()
print("No")

Submission status: Accepted

Solution code:
s = input()
if s.count("hi") * 2 == len(s):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = str(input())
 
S1 = S.replace("hi", "")
if S1 == "":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
ans = "No"

for i in range(1, 6):
    if s == "hi" * i:
        ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
s = input()

if s == 'hi':
  print('Yes')
elif s == 'hihi':
  print('Yes')
elif s == 'hihihi':
  print('Yes')
elif s == 'hihihihi':
  print('Yes')
elif s == 'hihihihihi':
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

HI ='hi'

flag = False

for i in range(5):
  if S == HI * (i +1):
    flag = True
    break

if flag == True:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = str(input())
#print(s[0]+s[1])

hitati = "hi"

for i in range(5):
  if s == hitati:
    print("Yes")
    exit()
  else:
    hitati += "hi"

print("No")

Submission status: Accepted

Solution code:
import re
s = input()
s = re.sub('hi','0',s)
s = re.sub('0','',s)
if s == '':
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
word=input()
if 'hi' == word:
    print('Yes')
elif 'hihi' == word:
    print('Yes')
elif 'hihihi' == word:
    print('Yes')
elif 'hihihihi' == word:
    print('Yes')
elif 'hihihihihi' == word:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
if s.count("hi")*2==len(s):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()

list_s = ["hi","hi"*2,"hi"*3,"hi"*4,"hi"*5]

if list_s.count(S) == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import defaultdict
from bisect import *
mod = 10**9+7

S = input()[:-1]
for i in range(5):
    if 'hi' * (i+1) == S:
        print('Yes')
        exit()
print('No')

Submission status: Accepted

Solution code:
s = list(input())

if len(s) % 2 == 1:
    print("No")
    exit()

for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "h":
            continue
        else:
            print("No")
            exit()
    else:
        if s[i] == "i":
            continue
        else:
            print("No")
            exit()
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()
for i in range(1,6):
  if S == "hi" * i:
    print("Yes")
    exit(0)
    
print("No")

Submission status: Accepted

Solution code:
s = input()
flg = True
while len(s) > 0:
    if s.startswith("hi"):
        s = s[2::]
    else:
        flg = False
        break
if flg:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
s = input()
a = ''
n = len(s)
if (n%2) != 0:
    print('No')
    sys.exit()

i = 0
while (n-i) > 0:
    if s[i:i+2] == ('hi'):
        i += 2
    else:
        print('No')
        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
S=input()
cnt=S.count("hi")
if(len(S) == cnt*2):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
f = False
chk = ''
for i in range(5):
    chk += 'hi'
    if s == chk:
        print('Yes')
        f = True
        break
if not f:
    print('No')

Submission status: Accepted

Solution code:
s = input()
for i in range(len(s)):
  if i & 1 == 0:
    if s[i] != 'h':
      break
  else:
    if s[i] != 'i':
      break
else:
  if len(s) & 1 == 0:
    print('Yes')
    exit()
print('No')

Submission status: Accepted

Solution code:
S = list(input())

word_num = int(len(S)/2)

temp_num = 0

if len(S) % 2 == 0:
    for i in range(word_num):
        if S[2*i]+S[2*i+1] == 'hi':
            pass
        else:
            temp_num += 1
else:
    pass

if len(S) % 2 == 0 and temp_num == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
flag=True
if len(S)==1:
    print("No")
    exit()
if len(S)%2==1:
    print("No")
    exit()
for i in range(len(S)):
    if i%2==0:
        if S[i]!="h":
            flag=False
            break
    else:
        if S[i]!="i":
            flag=False
            break
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=str(input())
a=S.count('hi')
if a*2==len(S):
    print('Yes')
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
ans = S.replace("hi", "")

if ans == "":
        print("Yes")
else:
        print("No")

Submission status: Accepted

Solution code:
a = input()
hi_cnt = a.count('hi')
if hi_cnt > 0:
    if hi_cnt * 2 == len(a):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input().split('i')

h = s[:len(s)-1]
space = s[len(s)-1]
ans = 'No'

for j in h:
  if j =='h' and space == '':
    ans = 'Yes'
  else:
    ans = 'No'
    break
  
print(ans)

Submission status: Accepted

Solution code:
S=list(str(input()))
A=''
B=''
while len(S)>0:
    A+=S.pop()
    if len(S)>0:
        B+=S.pop()
if (len(A)+len(B))%2!=0:
    print('No')
elif len(set(A))==len(set(B))==1:
    if 'h' in A or 'i' in A:
        if 'h' in B or 'i' in B:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
if input() in ('hi', 'hihi', 'hihihi', 'hihihihi', 'hihihihihi'):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#template
from sys import setrecursionlimit
setrecursionlimit(10**6)
from collections import Counter
def inputlist(): return [int(i) for i in input().split()]
#template
li = ['hi','hihi','hihihi','hihihihi','hihihihihi']
S = input()
if S in li:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

for i in range(1,6) :
    hita = "hi" * i
    if hita == S :
        print("Yes")
        exit()

print("No")

Submission status: Accepted

Solution code:
s = input()
oza = 'hi'
flag = 0
for i in range(0,len(s),2):
    if s[i:i+2] == oza:
        continue
    else:
        flag = 1
        print('No')
        break
if flag == 0:
    print('Yes')

Submission status: Accepted

Solution code:
# A = [list(map(int, input().split())) for _ in range(3)]
# k = int(input())
# B = [int(input()) for _ in range(n)]
# X = list(map(int, input().split()))
# a, b, c = map(int, input().split())
S = input()
n = len(S)
judge = True
if n % 2 != 0:
    print("No")
    exit()
for i in range(0, n, 2):
    if S[i] != "h" or S[i+1] != "i":
        judge = False
print("Yes") if judge else print("No")

Submission status: Accepted

Solution code:
S = input()

List = ['hihi', 'hi', 'hihihi', 'hihihihi', 'hihihihihi']

if S in List:
  print('Yes')
  
else:
  print('No')

Submission status: Accepted

Solution code:
import re
s = input()
if s == "hi" or s=="hihi" or s=="hihihi" or s=="hihihihi" or s== "hihihihihi": 
    print("Yes")
else:
    print("No")