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:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def cc():
	s = input()
	if len(s)%2 != 0:
		return False
	for i , c in enumerate(list(s)):
		if i % 2 == 0 and c != 'h':
			return False
		if i % 2 == 1 and c != 'i':
			return False
	return True
	
def main():
	ret = 'Yes' if cc() else 'No'
	return ret
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S = input()

f = True
l = len(S)
if l%2 != 0:
    print("No")
    exit()

for i in range(l):

    if (i%2 == 0 and S[i] == "h") or (i%2 == 1 and S[i] == "i"):
        f = True
    else:
        f = False
        break
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
input_str = input()

if input_str.replace("hi","") == "":
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()

i = 0
if len(S) % 2 != 0:
    print('No')
    exit()

while i + 1 <= len(S):
    if S[i] == 'h' and S[i+1] == 'i':
        i += 2
    else:
        break

if i == len(S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
ans = 'Yes'
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] != 'h':
            ans = 'No'
    else:
        if s[i] != 'i':
            ans = 'No'
if len(s) % 2 != 0:
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
S = str(input())
l = len(S)
if l%2 == 1:
    print("No")
else:
    k = 1
    for i in range (l//2):
        if S[2*i] != "h":
            k = 0
        if S [2*i + 1] != "i":
            k = 0
    if k == 0:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
string = input()
for i in range(len(string)):
    if i % 2 == 0:
        if string[i] == 'h':
            continue
        else:
            print('No')
            break
    elif i % 2 == 1:
        if string[i] == 'i':
            continue
        else:
            print('No')
            break
else:
    if len(string) % 2 == 1:
        print('No')
    else:
        print('Yes')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if n%2==0 and n//2==s.count("hi"):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

if __name__ == "__main__":
    S = input()
    if len(S) % 2 == 0:
        for i in range(0, len(S), 2):
            if S[i] == "h" and S[i+1] == "i":
                ret = "Yes"
            else:
                ret = "No"
                break
    else:
        ret = "No"
    print(ret)

Submission status: Accepted

Solution code:
def resolve():
    S = input()
    c = list(S)
    count = len(c)
    if count == 1 or count % 2 != 0:
        print('No')
        return

    if count == 2 and S != 'hi':
        print('No')
        return

    for i in range(0, count - 2, 2):
        if ''.join(c[i:i + 2]) != 'hi':
            print('No')
            return
    print('Yes')


resolve()

Submission status: Accepted

Solution code:
S = input()

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

else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if any(s == 'hi'*i for i in range(10)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import re

S = input()

s = re.search(r'^(hi)+$', S)

if s:
    print('Yes')
else:
    print('No')

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()

if len(S)%2 == 1:
    print('No')
else:
    for i in range(int(len(S)/2)):
        if S[i*2:i*2+2] != 'hi':
            print('No')
            break
    else:
        print('Yes')

Submission status: Accepted

Solution code:
S = input()
hitachi = ["h", 'i']
init = 0
for i in range(len(S)):
    if not hitachi[init] == S[i]:
        print("No")
        exit()
    init = 1 - init

if init:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

res = 'Yes'
if len(S) % 2 != 0:
  res = 'No'
else:
  cnt = len(S) // 2
  for i in range(cnt):
    if S[i * 2 : i * 2 + 2] == 'hi':
      continue
    else:
      res = 'No'

print(res)

Submission status: Accepted

Solution code:
S = input()
for i in range(10):
  if len(S) != 0 and S[:2] == 'hi':
      S = S[2:]
  elif len(S) == 0:
    print('Yes')
    exit()
  else:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
def solve():
  s=list(input())
  if(len(s)<2 or len(s)%2==1):
      print("No")
      return
  for i in range(len(s)):
      if (i%2==0 and s[i]!='h'):
          print("No")
          return
      elif(i%2==1 and s[i]!='i'):
          print("No")
          return
  print("Yes")

solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    # N = int(input())
    # N, M = map(int, input().split())
    # A = list(map(int, input().split()))
    S = input()
    # if 'hi' in S:
    #     print('Yes')
    # else:
    #     print('No')

    for i in range(len(S)):
        if i % 2 == 0 and S[i] != 'h':
            print('No')
            break
        if i % 2 != 0 and S[i] != 'i':
            print('No')
            break
    else:
        if S[-1] == 'i':
            print('Yes')
        else:
            print('No')





if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict, deque
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def IS(): return input().rstrip()
import re

def main():
    S = IS()
    if len(S)%2 == 1: print('No')
    elif 'hi'* (len(S)//2) == S: print('Yes')
    else: print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

i = 0

if(len(s) % 2 != 0):
    ans = "No"
else:
    while i < len(s):
        if(s[i] == 'h' and s[i+1] == 'i'):
            ans = "Yes"
        else:
            ans = "No"
            break
        i += 2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
s1 = "hi"
s2 = "hihi"
s3 = "hihihi"
s4 = "hihihihi"
s5 = "hihihihihi"
result = "No"

if S == s1:
    result = "Yes"
elif S == s2:
    result = "Yes"
elif S == s3:
    result = "Yes"
elif S == s4:
    result = "Yes"
elif S == s5:
    result = "Yes"
print(result)

Submission status: Accepted

Solution code:
S = list(input())
if len(S) == 1:
  print("No")
  exit()
flg = True
for i, s in enumerate(S):
  if i%2 == 0:
    if s != "h":
      flg = False
  else:
    if s != "i":
      flg = False
if flg and len(S)%2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
import textwrap

s=input()
c=-1
if "hi" not in s:
    print("No")
    sys.exit()
    
w=textwrap.wrap(s,2)

for i in w:
    if i!="hi":
        c=0
        break
if c==0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Sun Mar  8 12:16:38 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

s = ns()
n = len(s)
if n % 2 == 1:
    print("No")
else:
    i = 0
    cnt = 0
    while i < n - 1:
        if s[i] == 'h' and s[i + 1] == 'i':
            cnt += 2
        i += 2
    if cnt == n:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s = input()

judge = False

if len(s)%2 ==1:
    judge = True

for i in range(len(s)//2):
    if s[i*2:i*2+2] != "hi":
        judge = True

if judge:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
import sys
import 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
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(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

l = []
for i in range(0, len(S), 2):
    tmp = S[i:i+2]
    l.append(tmp)

flag = 0
for j in l:
    if j != 'hi':
        flag = 1
        break

if len(S) > 0 and flag == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S.count("hi") > 0:
    num = S.count("hi")
    S = S.replace("hi", "", num)
    if len(S) == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(str, input()))
flag = 0
for i in range(len(s)):
    if i%2 == 1 and s[i] != 'i':
        flag = 1
    elif i % 2 ==0 and s[i] != 'h':
        flag = 1
if len(s)%2 == 1:
    flag = 1
if flag == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())

for i in range(10):
    if "hi" * i == s:
        print("Yes")
        exit(0)

print("No")

Submission status: Accepted

Solution code:
s=input()
f=1
i=0
if len(s)%2!=0:
    print("No")
    exit()
while i<len(s):
    if s[i]=="h" and s[i+1]=="i":
        i+=2
    else:
        f=0
        break
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a = str(input())
b = len(a)
B = int(b/2)
c = 'hi'*B
if a == 'hi':
    print('Yes')
elif b/2 == 1 or b/2 == 2 or b/2 == 3 or b/2 == 4 or b/2 == 5:
    if a == c:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
rem=len(S)
ans='No'

if rem%2:
    pass
else:
    for i in range(rem//2):
        if S[2*i]=='h' and S[2*i+1]=='i':
            pass
        else:
            break  
    else:
        ans='Yes'
        
print(ans)

Submission status: Accepted

Solution code:
import sys
s = input()
x = -1
for i in s :
    x += 1
    if x % 2 == 0 :
        if s[x] != "h" :
            print("No")
            sys.exit()
    else :
        if s[x] != "i" :
            print("No")
            sys.exit()

if len(s)%2 != 0 :
    print("No")
    sys.exit() 

print("Yes")

Submission status: Accepted

Solution code:
import re

S = input()

answer = "No"

for i in range(0,len(S),2):
    if S[i:i+2] == "hi":
        answer = "Yes"
    else:
        answer = "No"



print(answer)

Submission status: Accepted

Solution code:
S = input()

string_num = len(S) // 2

is_true = True
if len(S) % 2 != 0:
    is_true = False

elif S.count('h') != string_num or S.count('i') != string_num:
    is_true = False

else:
    for i in range(0, len(S) - 1, 2):
        if S[i:i + 2] != 'hi':
            is_true = False

if is_true:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def hi(S):
    for i in S:
        if i != "":
            return False
    return True

S = input()
S = S.split('hi')

if hi(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
a = ""
ans = "No"
for i in range(5):
  a += "hi"
  if a == s:
    ans = "Yes"
    break
    
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

if S in ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
s = list(input())
c = len(s)
if c%2 == 1:
    print("No")
    sys.exit()
else:
    for i in range(c//2):
        if s[2*i] != "h" or s[2*i+1] != "i":
            print("No")
            sys.exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
a=0
if s=="hi":
    a=1
elif s=="hihi":
    a=1
elif s=="hihihi":
    a=1
elif s=="hihihihi":
    a=1
elif s=="hihihihihi":
    a=1
if a==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a  = input()
import re
k = re.split('(..)',a)[1::2]
result = 'Yes'
for i in range(len(k)):
  if k[i] != 'hi':
    result = 'No'

if len(a) % 2 == 1:
  print('No')
else:
  print(result)

Submission status: Accepted

Solution code:
S = list(input())
flag = True

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
    if S[i] == 'h' and S[i + 1] == 'i':
      pass
    else:
      flag = not flag
      break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
print('YNeos'[s != len(s) // 2 * 'hi'::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

l = S.split("hi")
if "".join(l):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S=input()
ans="Yes"
if len(S)%2==1:
    ans="No"
for i in range(len(S)//2):
    if S[2*i]!="h" or S[2*i+1]!="i":
        ans="No"
print(ans)

Submission status: Accepted

Solution code:
import sys

s  = str(input())

leng = len(s)

s1 = s.split('hi')

s2 = s1.count('')


counter = int(s2) - 1

what = int(leng / 2)

hi = "hi"

if counter == what:
  print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
length=int(len(S))
#print(length)

if length<=1:
    print("No")
elif length%2!=0 :
    print("No")
else:
    for i in range(length//2):
        if S[2*i]=="h" and S[2*i+1]=="i":
            temp=0
        else:
            print("No")
            temp=1
            break
            
    if temp==0:
        print("Yes")
    else:
        nothing=0

Submission status: Accepted

Solution code:
S = input()

def getHi(S):
    if len(S) % 2 == 1:
        return "No"
    for i in range(len(S)-1):
        if i % 2 == 0:
            if S[i] + S[i+1] != "hi":
                return"No"
        else:
            if S[i] + S[i+1] != "ih":
                return"No"
    return "Yes"

print(getHi(S))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys,re

def inn(func=int):
    return list(map(func,input().split()))

def ins():
    return input().split()

s = input()
ss = re.sub("(hi)+","",s)
if ss == "":
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
if len(s)%2!=0:
    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()
if(len(s)<=1):
    print('No')
    exit()

for i in range(len(s)-1):
    if(s[i]=='h'):
        if(s[i+1]=='i'):
            continue
        else:
            print('No')
            exit()
    elif(0<i and s[i]=='i'):
        if(s[i+1]=='h'):
            if(i+2<len(s) and s[i+2]=='i'):
                continue
            else:
                print('No')
                exit()
        else:
            print('No')
            exit()
    else:
        print('No')
        exit()
print('Yes')

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:
n = input()

if(len(n)%2==1):
  print ("No")
  exit()
i=0
while (i<len(n)):
  if i % 2 == 0:
    if n[i] != 'h':
      print('No')
      exit()
  else:
    if n[i] != 'i':
      print('No')
      exit()
  i = i+1
print('Yes')

Submission status: Accepted

Solution code:
S = input().strip()

if len(S) % 2 != 0:
    print("No")
else:
    hitach = "Yes"
    while len(S) > 0:
        s = S[0:2]
        S = S[2:]
        if s != "hi":
            hitach = "No"
            break
    print(hitach)

Submission status: Accepted

Solution code:
def main():
    S = input()
    ans = "Yes"
    if len(S) % 2 == 1:
        ans = "No"
    elif len(S) % 2 == 0:
        i = 0
        j = 2
        while j <= len(S):
            if S[i:j] == "hi":
                pass
            elif S[i:j] != "hi":
                ans = "No"
            i += 2
            j += 2
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import re

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    if len(S)%2!=0:
        print("No")
        exit()
    l=S[::2];count=0;p=S[1::2]
    #if len(l)
    for i in range(len(l)):
        if l[i]=="h":
            count+=1
        if p[i]=="i":
            count+=1
    if count==len(S):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

S = input()

if len(S) % 2 == 1:
    print('No')
    sys.exit()

for i in range(0, len(S), 2):
    if S[i:i + 2] == 'hi':
        continue
    else:
        print('No')
        sys.exit()
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()
for i in range(-(-len(S) // 2)):
  if S[2*i:2*i+2] == 'hi':
    out = 'Yes'
  else:
    out = 'No'
print(out)

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline

def main():
    s=input()
    cnt=len(s)//2
    chk='hi'*cnt
    if s==chk and s!='':
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

if len(S_replaced) > 0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    S = input()

    S_list = list(S)

    if len(S_list) % 2 == 0:
        s_len = int(len(S_list) / 2)
        if S == s_len * 'hi':
            print('Yes')
            return

    print('No')
    return

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
S = input()

res = []
if len(S) % 2 == 1:
    print('No')
else:
    for i in range(len(S)//2):
        if i % 2 == 0:
            res.append(S[2*i:2*(i+1)])
    ans = set(res)
    
    if ans == {'hi'}:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
S = str(input())
if "hi" == S:
  print("Yes")
elif "hihi" == S:
  print("Yes")
elif "hihihi" == S:
  print("Yes")
elif "hihihihi" == S:
  print("Yes")
elif "hihihihihi" == S:
  print("Yes") 
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
s=input().rstrip()
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().replace('hi', '1')
if set(list(s)) == {'1'}:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
S = input()
if len(S) % 2 == 1:
  print("No")
else:
  ans = "Yes"
  for i in range(0, len(S), 2):
    if S[i] != "h" or S[i+1] != "i":
      ans = "No"
  print(ans)

Submission status: Accepted

Solution code:
def main():
    flag = True
    S = input()
    if len(S) < 2 or S[-1] != 'i': flag = False
    if flag:
        for enum, i in enumerate(S):
            if enum % 2 == 0:
                if i != 'h':
                    flag = False
                    break
            else:
                if i != 'i':
                    flag = False
                    break
    if flag:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 != 0:
    print("No")
    exit(0)

ans = True
for i, s in enumerate(S):
    if (i % 2 == 0) and (s != 'h'):
        ans = False
        break
    if (i % 2 != 0) and (s != 'i'):
        ans = False
        break

if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
if sum(list(map(len, S.split("hi")))) == 0:
    ans = 'Yes'
else :
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
s=input()
cnt=0
ans="No"
flag=True

while cnt<len(s):
  if len(s)==1 or len(s)%2==1:
    flag=False
    break
  if s[cnt]=="h" and s[cnt+1]=="i":
    cnt+=2
    continue
  else:
    flag=False
    break
if flag:
  ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
s = input()
if len(s) % 2 == 1:
    print("No")

else:
    i = 0
    flag = False
    while i+1 < len(s):
        if s[i:i+2] != "hi":
            flag = True
            break
        i += 2
    
    if flag:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
S = input()
list = ["hi","hihi","hihihi","hihihihi","hihihihihi"]
if S in list:
    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()

A = S.count('hi')
B = len(S)

if 2*A == B:
    print('Yes')
else: 
    print('No')

Submission status: Accepted

Solution code:
S = str(input())
if "hi" in S and S.replace('hi', '') == "":
  print("Yes")
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()
for i in range(5):
    if s=='hi'*(i+1):
        print('Yes')
        break
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = str(sys.stdin.readline().rstrip())
    T = [N[i: i + 2] for i in range(0, len(N), 2)]

    for t in T:
        if t != 'hi':
            print('No')
            exit()

    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
d = {"h":0, "i":0}
S = input()
if len(S) % 2 == 1:
    print("No")
    exit()
flag = True
for i in range(0, len(S)-1, 2):
    if S[i:i+2] != "hi":
        flag = False
        break
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
# Code for A - Hitachi String
# Use input() to fetch data from STDIN
s = input()
def solve():
    if len(s) % 2 != 0:
        print("No")
        return

    for i, x in enumerate(s):
        if i % 2 == 0 and not x == "h":
            print("No")
            return
        if i % 2 == 1 and not x == "i":
            print("No")
            return

    print("Yes")

solve()

Submission status: Accepted

Solution code:
import math
import itertools
import statistics
#n = int(input())
#a, b = list(map(int, input().split()))
s = input()

if len(s)%2==1:
    print("No")
else:
    for i in range(len(s)):
        if i%2==0:
            if s[i]=="h" and s[i+1]=="i":
                #print("Yes")
                #exit()
                flag = True
            else:
                print("No")
                exit()

    print("Yes")

"""
if len(s)%2==1:
    print("NO")
else:
    for i in range(0, len(s), 2):
        if i%2==0:
            if s[i]=="h" and s[i+i]=="i":
                flag = True
            else:
                print(s[i])
                print(s[i+1])
                print("No")
                exit()
    print("Yes")
"""

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()

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

Submission status: Accepted

Solution code:
import re

s = input()

m = re.match(r'^(hi)*$', s)
if m is not None and m.group(0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = str((input()))
count = 0

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

for i in range(len(s)-1):
    if s[i] == "h" and s[i+1] == "i":
        count += 1
if count == len(s) // 2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
hantei = True

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

Submission status: Accepted

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    S = sr()
    if len(S)%2 == 1:
        print('No')
        return
    for i in range(len(S)):
        if (i%2 == 0 and S[i] == 'h') or (i%2 == 1 and S[i] == 'i'):
            continue
        print('No')
        return
    print('Yes')
resolve()

Submission status: Accepted

Solution code:
#coding:utf-8
s = input()
l = len(s)

if len(s) % 2 != 0:
    print('No')
else:
    for i in range(0, l, 2):
        #print(s[i:i+2])
        if s[i:i+2] != 'hi':
            print('No')
            exit()
    print('Yes')

Submission status: Accepted

Solution code:
s = list(input())
ans = 0
cnt = 0
if len(s) % 2 != 0:
    print("No")
else:
    for i in range(int(len(s)/2)):
        if s[2*i] == "h" and s[2*i+1] == "i":
            cnt += 1
        #print(cnt)
    if cnt == int(len(s)/2):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
N=input()
b=len(N)
c=N.count("h")
d=N.count("i")
e="hi"
f="hihi"
g="hihihi"
h="hihihihi"
i="hihihihihi"
if N==e or N==f or N==g or N==h or N==i:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

s = input()
if len(s) == 0:
    print('No')
    exit()


for i, letter in enumerate(s):
    if i % 2 == 0:
        if letter != 'h':
            print('No')
            exit()
    elif i % 2 != 0:
        if letter != 'i':
            print('No')
            exit()

if len(s) % 2 == 0:
    print('Yes')
else:
    print('No')

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()

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

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