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: Wrong Answer

Solution code:
import sys
S= list(str(input()))
for i in range(len(S)):
    if S[i]=='h'and S[i+1]=='i':
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
S = str(input())
ans = 0
if len(S) == 1:
    print('No')
    ans = 1
if S[-1] == 'h':
    print('No')
    ans = 1
for i in range(len(S)-1):
    if S[i] == 'h' and S[i+1] != 'i':
        print('No')
        ans = 1
        break
if ans == 0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
input_line = input()
input_num = len(input_line)
ans = 'Yes'
for i in range(input_num):
  if input_line[i] == 'h':
    if i + 1 < input_num:
      if input_line[i + 1] == 'i':
        i = i + 2
      else:
        ans = 'No'
        break
  else:
    ans == 'No'
    break
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
strJudge = 'No'
if 'hi' in s:
    strJudge = 'Yes'

if len(s) == 3:
    s = s.replace('hi','')
    
if len(s) == 1:
    strJudge = 'No'

print(strJudge)

Submission status: Wrong Answer

Solution code:
S = input()
 
j_S = 'hi'
j_b = ['a','i','o','u','e']
j_b2 =  ['a','o','u','e']

if len(S) > 1:
    if not j_S in S:
        print('No')    
    else:
        i = 0
        for in_b in j_b:
            j_S_b = j_S + in_b
            if j_S_b in S:
                i+=1
        for in_b in j_b2:
            j_S2_b = 'h' + in_b
            if j_S2_b in S:
                i+=1
                
        if i==0:
            print('Yes')
        elif i > 0:
            print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    input_ = input()
    
    if len(input_) < 2:
        print('No')
    elif 'hi' in input_:
        print('Yes')
    else:
        print('No')

    return 0


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import re
index = re.match(r'.*(hi)+.*', input())
if index:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = str(input())
ans = 0
if len(S) == 1:
    print('No')
    ans = 1
for i in range(len(S)-1):
    if S[i] == 'h' and S[i+1] != 'i':
        print('No')
        ans = 1
        break
if ans == 0:
    print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()

a = 0
if 'hi' in s:
  if 'hii' not in s:
    a += 1
    
if a == 1:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
strJudge = 'No'
if 'hi' in s:
    strJudge = 'Yes'

s = s.replace('hi','')
if len(s) == 1:
    strJudge = 'No'

print(strJudge)

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
        count_hii += 1

if count_hi > count_hii:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
        count_hii += 1

print(str(count_hi))
print(str(count_hii))

if count_hi > count_hii:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
string = input()
flag = False
 
num = len(string)
if num % 2 == 0:
  for i in range(num //  2 - 1):
    if string[2*i:2*(i+1)] == "hi":
      if i == num // 2 - 1:
        flag = True
    else:
      break

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)

if n == 1:
    print('No')
elif n == 2:
    if s == 'hi':
        print('Yes')
    else:
        print('No')
elif n == 3:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi':
        print('Yes')
    else:
        print('No')
elif n == 4:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi':
        print('Yes')
    else:
        print('No')
elif n == 5:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi' or s[3] + s[4] == 'hi':
        print('Yes')
    else:
        print('No') 
elif n == 6:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi' or s[3] + s[4] == 'hi' or s[4] + s[5] == 'hi':
        print('Yes')
    else:
        print('No') 
elif n == 7:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi' or s[3] + s[4] == 'hi' or s[4] + s[5] == 'hi' or s[5] + s[6] == 'hi':
        print('Yes')
    else:
        print('No') 
elif n == 8:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi' or s[3] + s[4] == 'hi' or s[4] + s[5] == 'hi' or s[5] + s[6] == 'hi' or s[6] + s[7] == 'hi':
        print('Yes')
    else:
        print('No')
elif n == 9:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi' or s[3] + s[4] == 'hi' or s[4] + s[5] == 'hi' or s[5] + s[6] == 'hi' or s[6] + s[7] == 'hi' or s[7] + s[8] == 'hi':
        print('Yes')
    else:
        print('No')
elif n == 10:
    if s[0] + s[1] == 'hi' or s[1] + s[2] == 'hi' or s[2] + s[3] == 'hi' or s[3] + s[4] == 'hi' or s[4] + s[5] == 'hi' or s[5] + s[6] == 'hi' or s[6] + s[7] == 'hi' or s[7] + s[8] == 'hi' or s[8] + s[9] == 'hi':
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

import re

input = input()

pattern = '^(hi)+$'

# compile後match
repatter = re.compile(pattern)
result = repatter.fullmatch(input)

if result is not None:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
S = input()

j_S = 'h'
j_S2 = 'hi'
j_b = ['a','o','u','e']


if len(S) > 1:    
    i = 0
    for in_b in j_b:
        j_S_b = j_S + in_b
        if j_S_b in S:
            i+=1
    if j_S2 in S:
        for in_b in j_b:
            j_S2_b = j_S2+ in_b
            if j_S_b in S:
                i+=1
    if i==0:
        print('Yes')
    elif i > 0:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
        count_hii += 1

if count_hi - count_hii == count_hi:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
        count_hii += 1

print(str(count_hi))
print(str(count_hii))

if count_hi - count_hii == count_hi:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import re
index = input().count("hi")
if index!=0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
W=S.split("hi")
A = set(W)
B = list(A)
C =len(B)

if C==1:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S = input()
if 'hii' in S:
  S.replace("hii", "")
  S.replace("hiii", "")
cout = S.count('hi')
if cout > 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
i = 0
count = 0

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

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

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
        count_hii += 1

if count_hi > 0 and count_hii >= 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
letter = input()
 
reve = 0
tr = 0
 
 
for kk in range(len(letter)):
    if letter[kk] == "h" and reve == 0:
        reve = 1
    elif letter[kk] == "i" and reve == 1:
        reve = 0
    else:
        tr = 1
 
if tr == 0 and 'hi' in letter:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
i=0;
found=True;
h=0;
k=0;
if(len(s)%2!=0):
	found=False
else:
	while(i<len(s)):
		if(s[i]=='h' or s[i]=='i'):
			if(i%2==0 and s[i]=='h'):
				found=True
			if(i%2!=0 and s[i]=='i'):
				found=True
			if(i%2!=0 and s[i]=='h'):
				found=False
			if(i%2==0 and s[i]=='i'):
				found=False
			
		else:
			found=False
			break;		
		i=i+1
if(found==False):
	print("No")
else:
	print("Yes")

Submission status: Wrong Answer

Solution code:
import sys
S = input()
if len(S) == 1:
  print('No')
else:
  i = 0
  while i+2 <= len(S):
    if S[i:i+2] == 'hi':
      print('Yes')
      sys.exit(0)
    i+=1
print('No')

Submission status: Wrong Answer

Solution code:
S = input()

j_S = 'hi'
j_b = ['a','i','o','u','e']

if len(S) > 1:
    if not j_S in S:
        print('No')    
    else:
        i = 0
        for in_b in j_b:
            j_S_b = j_S + in_b
            if j_S_b in S:
                i+=1
        if i==0:
            print('Yes')
        elif i > 0:
            print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
        count_hii += 1

if count_hi > 0 and count_hii == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input() #ここで標準入力
if S.count('hi') == 0:
	print('No')
elif S.count('hii') > S.count('hi'):
	print('No')
elif S.count('hi') > 0:
  	print('Yes')

Submission status: Wrong Answer

Solution code:
S = list(input())

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

if len(S) == 2 and S == "hi":
    print("Yes")
    exit()
elif len(S) == 4 and S == "hihi":
    print("Yes")
    exit()
elif len(S) == 6 and S == "hihihi":
    print("Yes")
    exit()
elif len(S) == 8 and S == "hihihihi":
    print("Yes")
    exit()
elif len(S) == 10 and S == "hihihihihi":
    print("Yes")
    exit()

Submission status: Wrong Answer

Solution code:
n = input()

ans = "No"
if "hi" in n:
    ans = "Yes"

if "hhi" in n:
    ans = "No"

if "hii" in n:
    ans = "No"

if n.count("hi") != 1:
    if n.count("hihi") == 0:
        if n.count("hihihi") == 0:
            if n.count("hihihihi") == 0:
                if n.count("hihihihihi") == 0:
                    ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
r = "Yes"
for i in range(len(S)):
  if (i % 2 == 0 and S[i] != "h") or (i % 2 == 1 and S[i] != "i"):
    r = "No"
    break
print(r)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)

if n == 1:
    print('No')
elif n == 2:
    if s == 'hi':
        print('Yes')
else:
    if 'hi' in s:
        print('Yes')
    else:
        print('No')

Submission status: Wrong Answer

Solution code:
letter = input()
 
reve = 0
tr = 0

 
for kk in range(len(letter)):
    if letter[kk] == "h" and reve == 0:
        reve = 1
    elif letter[kk] == "i" and reve == 1:
        reve = 0
    else:
        tr = 1
 
if tr == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = int(len(S)/2)

[print('Yes') if S == 'hi'*N else print('NO')]

Submission status: Wrong Answer

Solution code:
s = input()

if "hi" in s:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
input_line = input()
input_num = len(input_line)
ans = 'No'
for i in range(input_num):
  if input_line[i] == 'h':
    if i + 1 < input_num:
      if input_line[i + 1] == 'i':
        if i+2 < input_num:
          if input_line[i+2]!='i':
            ans = 'Yes'
            break
        else:
            ans = 'Yes'
            break
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    ans = 'No'
    if 'hi' in s:
        ans = 'Yes'
    if 'hii' in s:
        ans = 'No'
        
    if len(s) >= 3:
        for i in range(len(s)-2):
            if s[i] + s[i+1] == 'hi' and s[i+2] != 'i':
                ans = 'Yes'
    
        if s[-2] + s[-1] == 'hi':
            ans = 'Yes'

    return ans

print(solve())

Submission status: Wrong Answer

Solution code:
S = input()
ans = 'No'
for i in range(len(S)):
    if S[i:i+2] == 'hi':
        if i+3 > len(S) or S[i+2] != 'i':
            ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
S = str(input())
ans = 0
for i in range(len(S)-1):
    if S[i] == 'h' and S[i+1] == 'i':
        print('Yes')
        ans = 1
        break
if ans == 0:
    print('No')

Submission status: Wrong Answer

Solution code:
str = input()
str_len = len(str)
h_flag = 0
for cat_i in range(str_len):
  if h_flag == 0 and str[cat_i] == 'h':
    h_flag = 1
  elif h_flag == 1 and str[cat_i] == 'i':
    h_flag = 0
  else:
    print('No')
    break
    
  if cat_i == (str_len - 1):
    print('Yes')

Submission status: Wrong Answer

Solution code:
S = input()

j_S = 'hi'
j_b = ['a','i','o','u','e']

if not j_S in S:
    print('No')    
else:
    i = 0
    for in_b in j_b:
        j_S_b = j_S + in_b
        if j_S_b in S:
            i+=1
    if i==0:
        print('Yes')
    elif i > 0:
        print('No')

Submission status: Wrong Answer

Solution code:
s = input()
if len(s) < 1 or len(s) >10:
    ans = False
if len(s) >= 1 or len(s) <= 10:
    if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihhihi' or s == 'hihihihihi':
        ans =True
    else:
        ans =False
if ans:
    print ('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
def main():
    a, b, m = map(int, input().split())
    priceOfMicrowaves = list(map(int, input().split()))
    priceOfRefrigerators = list(map(int, input().split()))
    priceTable = [list(map(int,input().split())) for i in range(m)]
    cheepest = priceOfMicrowaves[0] + priceOfRefrigerators[0]
    for p in priceOfMicrowaves:
        for q in priceOfRefrigerators:
            if p + q < cheepest:
                cheepest = p + q
    for price in priceTable:
        if priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2] < cheepest:
            cheepest = priceOfMicrowaves[price[0]-1]+priceOfRefrigerators[price[1]-1]-price[2]
    print(cheepest)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    input_ = input()
    
    if 'hi' in input_:
        print('Yes')
    else:
        print('No')

    return 0


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def main():
    S = input()

    for i in range(1, 5):
        h = 'hi' * i
        if S == h:
            print('Yes')
            return
    else:
        print('No')

main()

Submission status: Wrong Answer

Solution code:
s = input()
strJudge = 'No'
if 'hi' in s:
    strJudge = 'Yes'

if 'hii' == s:
    strJudge = 'No'

print(strJudge)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=input()
flg=0
for i in range(len(a)//2):
  if not a[2*i]=='h' and a[2*i+1]=='i':
  	flg=1   
if len(a)%2!=0 or flg==1:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S) - 1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
            count_hii += 1

if count_hi > 0 and count_hii == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# A
s = input()

if s.count('hi') > 0 and s.count('hii') == 0 and s.count('hhi') == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(input())

if "".join(list(dict.fromkeys(S))) == "hi" and S.count("h") == S.count("i"):
    print("Yes")
    exit()

print("No")

Submission status: Wrong Answer

Solution code:
n = input()
l = n.split("i")
#print(len(n))
#print(l)
i = len(l)-1
#print(n)
#print(i)
if len(n)/2==0:
    if i==0:
        print("No")
    elif i==1:
        if n[0]=="h":
            print("Yes")
        else:
            print("No")
    elif i==2:
        if n[0]==n[1]=="h":
            print("Yes")
        else:
            print("No")
    elif i==3:
        if n[0]==n[1]==n[2]=="h":
             print("Yes")
        else:
            print("No")
    else:
        if n[0]==n[1]==n[2]==n[3]=="h":
            print("Yes")
        else:
            print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
#import math
#import numpy as np

'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
a=input()
li=list(a)
li.append('y')
ans=0
#print(len(a))
#print(li)
if len(a)>10:
  print('No')
  sys.exit()
for i in range(len(a)-1):
  if li[i]=='h' and li[i+1]=='i' and li[i+2]!='i':
    ans+=1
    #print(ans)
if ans>0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
# A
s = input()

if s.count('hi') > 0 and s.count('hii') == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
flag = True
ans = True
if len(s) == 1 or len(s)>10:
        ans = False
if len(s) != 1 and len(s) <=10:
    while s :
        if flag:
            if s.pop() == 'i':
                ans = True
                flag = False
            else:
                ans = False
                break
        else:
            if s.pop() == 'h':
                ans = True
                flag = True
            else:
                ans = False
                break
if ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]!="h":
    print("No")
    exit()
if len(S)<2:
    print("No")
    exit()
han="i"
for i in range(1,len(S)):
    if S[i]!=han:
        print("No")
        exit()
    if S[i-1]=="h":
        han="h"
    elif S[i-1]=="i":
        han="i"
print("Yes")

Submission status: Wrong Answer

Solution code:
n = input()

ans = "No"
if "hi" in n:
    ans = "Yes"
"""
if "hhi" in n or "hii" in n:
    if n.count("hi") - n.count("hii") - n.count("hhi") + n.count("hhii")== 0:
        ans = "No"
"""
if "hii" in n:
    if n.count("hi") - n.count("hii") == 0:
        ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
flg=0
for i in range(len(a)//2):
  if not a[2*i]=='h' and a[2*i+1]=='i':
  	flg=1   
if len(a)%2!=0:
  print("No")
elif flg==1:    
  print("No")
elif flg==0:
  print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
strJudge = 'No'
if 'hi' in s:
    strJudge = 'Yes'

if 'hii' in s:
    strJudge = 'No'

print(strJudge)

Submission status: Wrong Answer

Solution code:
def main(S):
    isHitachi = False
    for i in range(len(S)-2):
        a = S[i]
        b = S[i+1]
        c = S[i+2]

        if a == 'h' and b == 'i' and c != 'i':
            isHitachi = True
        if b == 'h' and c == 'i':
            isHitachi = True
    
    if isHitachi:
        print('Yes')
    else:
        print('No')

S = input()
main(S)

Submission status: Wrong Answer

Solution code:
S = input()
if 'hii' in S:
  S.replace("hii", "")
cout = S.count('hi')
if cout > 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = input()
flag = False
for i in range(len(s)-1):
    if s[i] == "h" and s[i+1] == "i":
        if i < len(s)-2:
            if s[i+2] == "i":
                pass
            elif s[i+2] != "i":
                flag = True
                break
        else:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
strJudge = 'No'
if 'hi' in s:
    strJudge = 'Yse'

if 'hii' in s:
    strJudge = 'No'

print(strJudge)

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]!="h":
    print("No")
    exit()
han="i"
for i in range(1,len(S)):
    if S[i]!=han:
        print("No")
        exit()
    if S[i-1]=="h":
        han="h"
    elif S[i-1]=="i":
        han="i"
print("Yes")

Submission status: Wrong Answer

Solution code:
#N=int(input())
#N,M=map(int, input().split())
#L=list(map(int, input().split()))
S = str(input())
if len(S)==1:
  print('No')
  exit()
n = 0
while len(S) > n:
    if n % 2 == 1 and S[n] != 'i':
        print('No')
        exit()
    elif n % 2 == 0 and S[n] != 'h':
        print('No')
        exit()
    n += 1

print('Yes')

Submission status: Wrong Answer

Solution code:
h = [str(i) for i in input()]

j = 0
for a in range(len(h)-1):
  b = h[a]+h[a+1]
  if b == 'hi':
    j += 1
    
if j > 0:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
flag = True
ans = True
if len(s) == 1:
        ans = False
if len(s) != 1:
    while s :
        if flag:
            if s.pop() == 'i':
                ans = True
                flag = False
            else:
                ans = False
                break
        else:
            if s.pop() == 'h':
                ans = True
                flag = True
            else:
                ans = False
                break
if ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import re
index = re.match(r'([a-z]+)(hi)+([a-z]+)', input())
if index:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s=input()
flg=0
if len(s)%2!=0:
        print("No")
else:
    for i in range(0,len(s)-1,2):
        if s[i:i+2]!="hi":
            flg +=1
            break
        continue
if flg==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
s = list(input())
print(s)
flag = True
ans = True
if len(s) == 1:
        ans = False
if len(s) != 1:
    while s :
        if flag:
            if s.pop() == 'i':
                ans = True
                flag = False
            else:
                ans = False
                break
        else:
            if s.pop() == 'h':
                ans = True
                flag = True
            else:
                ans = False
                break
if ans:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
S = list(input())
for i in range(len(S)):
    if i%2 == 0:
        if S[i] != 'h':
            print("No")
            sys.exit()
    else:
        if S[i] != 'i':
            print("No")
            sys.exit()
print("Yes")

Submission status: Wrong Answer

Solution code:
string = input()
flag = False
 
num = len(string)
if num % 2 == 0:
  for i in range(num //  2 - 1):
    if string[2*i:2*(i+1)] == "hi":
      continue
    else:
      break
  flag = True

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

Submission status: Wrong Answer

Solution code:
a=input()
flg=0
for i in range(len(a)//2):
  if not a[2*i]=='h' and a[2*i+1]=='i':
  	flg=1
if flg==1:    
	print("No")
else:
  	print("Yes")

Submission status: Wrong Answer

Solution code:
a=input()
flg=0
print(len(a)//2)
for i in range(len(a)//2):
  print(2*i,2*i+1)
  
  if not a[2*i]=='h' and a[2*i+1]=='i':
  	flg=1
if flg==1:    
	print("No")
else:
  	print("Yes")

Submission status: Wrong Answer

Solution code:
S = list(input())

if "".join(list(dict.fromkeys(S))) == "hi":
    print("Yes")
    exit()

print("No")

Submission status: Wrong Answer

Solution code:
s = input()
if 'hi' in s and 'hii' not in s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n = input()

ans = "No"
if "hi" in n:
    ans = "Yes"

if "hhi" in n or "hii" in n:
    if n.count("hi") - n.count("hii") - n.count("hhi") + n.count("hhii")== 0:
        ans = "No"
if "ihi" in n or "hih" in n:
    if n.count("hi") - n.count("hih") - n.count("ihi") + n.count("ihih")== 0:
        ans = "No"
print(ans)

Submission status: Wrong Answer

Solution code:
import re
index = re.match(r'(hi)+', input())
if index:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
string = input()
flag = False
 
num = len(string)
if num % 2 == 0:
  for i in range(num //  2 - 1):
    if string[2*i:2*(i+1)] == "hi":
      continue
    else:
      break
    flag = True

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

Submission status: Wrong Answer

Solution code:
str = input()
yes = True
if len(str) < 2:
  yes = False
for i in range(len(str)):
  if (i % 2 == 0 and str[i] != 'h') or (i % 2 == 1 and str[i] != 'i'):
    yes = False
    break
  if i > 10:
    break
print("Yes" if yes else "No")

Submission status: Wrong Answer

Solution code:
S = input() #ここで標準入力
if 'hii' in S:
	print('No')
elif 'hi' in S:
	print('Yes')
else:
	print('No')

Submission status: Wrong Answer

Solution code:
import re
S = input()
if (re.search('hi+[^h]',S)):
  print('No')
elif (re.search('hi',S)):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
S = input()
idx = 0
try:
    while True:
        idx = S.index('hi', idx)
        if idx == len(S)-2 or S[idx+1] != 'i':
            print('Yes')
            break     
        else:
            idx += 3
except:
    print('No')

Submission status: Wrong Answer

Solution code:
n=input()
if n.find('hi') != -1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a = input()

n = a.count('hi')
b = a.count('hii')

if(n>0 and n!=b):
 print("Yes\n")
else:
 print("No\n")

Submission status: Wrong Answer

Solution code:
a=input()
flg=0
for i in range(len(a)//2):
  if not a[i]=='h' and a[i+1]=='i':
  	flg=1
if flg==1:    
	print("No")
else:
  	print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
pattern = ''
cnt = len(S)//2
for _ in range(cnt):
    pattern += 'hi'
    print(pattern)
if S == pattern:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = list(map(str,input()))
count_hi = 0
count_hii = 0


for i in range (0, len(S) - 1):
    if S[i] == 'h' and S[i+1] == 'i':
        count_hi += 1

for i in range(0, len(S) - 2):
    if S[i] == 'h' and S[i+1] == 'i' and S[i+2] == 'i':
            count_hii += 1

if count_hi - count_hii > 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=list(input())
tmp=""
ans="No"
for s in S:
    if(tmp==""):
        tmp=s
    else:
        if(s=='i' and tmp=='h'):
            ans="Yes"
            tmp=''
        else:
            ans="No"
            break
print(ans)

Submission status: Wrong Answer

Solution code:
str = input()

if "hi" in str:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
letter = input()

if 'hi' in letter:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
W=S.split("hi")
A = W.count('')
A =int(A)
if A==0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

Solution code:
S = input() #ここで標準入力
if 'hii' in S:
	print(False)
elif 'hi' in S:
	print(True)
else:
	print(False)

Submission status: Wrong Answer

Solution code:
a = input()
l = list(a)
num = len(l)
TorF = True

if num % 2 == 0:
    b = int(num/2)
    for i in range(b):
        if not a[2*i] == 'h' and a[2*i + 1] == 'i':
            TorF = False
            break
else:
    TorF = False

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

Submission status: Wrong Answer

Solution code:
s=input()
if 'hi' in s:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
idx = 0
try:
    while True:
        idx = S.index('hi', idx)
        if idx == len(S)-2 or S[idx+1] != 'i':
            print('Yes')
            break     
        else:
            idx += 1
except:
    print('No')

Submission status: Wrong Answer

Solution code:
import re
index = re.search(input(),'(hi)+')
if index:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

S = input()

flag = 0

for s in S:
    if s == "h":
        flag = flag + 1
        if flag >= 2:
            print("No")
            sys.exit()
    elif s == 'i':
        flag = flag - 1
        if flag < 0:
            print("No")
            sys.exit()
    else:
        print("No")
        sys.exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
S=list(input())
tmp=""
ans="No"
for s in S:
    if(tmp==""):
        tmp=s
    else:
        if(s=='i' and tmp=='h'):
            ans="Yes"
            tmp=''
        else:
            tmp=""
            ans="No"
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()

ans = "No"
if "hi" in n:
    ans = "Yes"

if "hhi" in n or "hii" in n:
    if n.count("hi") - n.count("hii") - n.count("hhi") + n.count("hhii")== 0:
        ans = "No"

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

if len(S) == 1:
  print('No')
elif len(S) == 2:
  if S == 'hi':
    print('Yes')
  else:
    print('No')
else:
  flag = 0
  i = 0
  while i < len(S)-1:
    if S[i:i+2] == 'hi':
      flag = 1
    else:
      flag = 0
      break
    i += 2
  if flag == 1:
    print('Yes')
  else:
    print('No')

Submission status: Wrong Answer

Solution code:
string = input()
flag = True
 
num = len(string)
if num % 2 == 0:
  for i in range(num //  2 - 1):
    if string[2*i:2*(i+1)] != "hi":
      flag = False
      break
else:
  flag = False
 
if flag:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a=input()
flg=0
for i in range(len(a)-1):
  if not a[i]=='h' and a[i+1]=='i':
  	flg=1
if flg==1:    
	print("No")
else:
  	print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()
flag = False
for i in range(len(s)-1):
    if s[i] == "h" and s[i+1] == "i":
        if i < len(s)-2:
            if s[i+2] == "i":
                pass
        elif i < len(s)-2:
            if s[i+2] != "i":
                flag = True
                break
        else:
            flag = True
if flag:
    print("Yes")
else:
    print("No")