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: Runtime Error

Solution code:
hitachi = input()
#type(hitachi)
flag = 0
if(len(hitachi) == 1):
    hitachi += " "
for x in range(len(hitachi)):
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            #print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            #print(hitachi[x] + hitachi[x+1])
            print("No")
            break
if(flag == len(hitachi)/2):
    print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
inp = input().split(" ")
A=int(inp[0])
B=int(inp[1])
M=int(inp[2])

if A!=0:
    a=input().split(" ")
else:
    a=[0]
if B!=0:
    b=input().split(" ")
else:
    b=[0]

s=[0]*(M+(1))
m=[[0]*3]*M
i=0
for x in m:
    x=input().split(" ")
    s[i]=int(a[int(x[0])-1])+int(b[int(x[1])-1])-int(x[2])
    i+=1

s[i]=int(min(a))+int(min(b))

print(min(s))

Submission status: Runtime Error

Solution code:
A, B, M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
minimum = a[0]+b[0]

for k in range(M):
    x,y,c = map(int,input().split())
    tmp = a[x-1]+b[y-1]-c
    if minimum > tmp:
        minimum = tmp

a.sort()
b.sort()

for i in a:
    if i + b[0] > minimum:
        break
    for j in b:
        tmp = i + j
        if minimum > tmp:
            minimum = tmp
        else:
            break

print(minimum)

Submission status: Runtime Error

Solution code:
hitachi = input()
flag = 0
for x in range(len(hitachi)):
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            #print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            #print(hitachi[x] + hitachi[x+1])
            print("No")
            break
if(flag == len(hitachi)/2):
    print("Yes")

Submission status: Runtime Error

Solution code:
hitachi = input()
flag = 0
for x in range(len(hitachi)):
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            print(hitachi[x] + hitachi[x+1])
            print("No")
            break
print(flag)
print(int(len(hitachi)/2))
if(flag == len(hitachi)/2):
    print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
st = []
if len(S) %2 != 0 :
    print('No')
else :
    for i in range(len(S) // 2) :
        st.append(S[i:i+2])
      
    st = list(set(st))) 
    if len(st) == 1 and st[0] == 'hi' :
        print('Yes')
    else :
        print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
hitachi = input()
print(hitachi)
flag = 0
for x in range(len(hitachi)):
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            flag = 1
        else:
            print(hitachi[x] + hitachi[x+1])
            print("No")
            break

if(flag == len(hitachi)/2):
    print("Yes")

Submission status: Runtime Error

Solution code:
#1 question on hitachi contest
class Solution:
    def answer(self, str_in):
        n = len(str_in)
        if n == 1:
            return "No"
        
        i = 1
        arr = []

        for i in range(0,len(str_in)):
            
            if str_in[i] == 'h' and str_in[i+1]== 'i':
                arr.append(i)
                
            elif str_in[i] == 'i' and str_in[i-1] == 'h':
                
                if arr == []:
                    return "No"
                else:
                    arr.pop()
            else:
                return "No"
        if arr == []:
            return "Yes"
        else:
            return "No"

str_in = input()

s = Solution()
print(s.answer(str_in))

Submission status: Runtime Error

Solution code:
S = input()
target = 'hi'
index == -1
index = S.find(target)
if 10 >index > -1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
a=input()

if a=="hi"*(len(a)//2):
	print("Yes")
else:
	print"No"

Submission status: Runtime Error

Solution code:
s = input()

result = re.fullmatch("(hi){1,5}",s)

if result == None:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
import sys
 
lines = sys.stdin.readlines()
num_a ,num_b, num_m = [int(v) for v in lines[0].split()]
# ----
 
a_list = [int(v) for v in lines[1].split()[:num_a+1]]
b_list = [int(v) for v in lines[2].split()[:num_b+1]]
 
# print(a_list)
# print(b_list)
 
result = max(a_list) + max(b_list)
ignores = set()
for c in lines[3:num_m+3]:
    a_i, b_i, discount = map(int, c.split())
    try:
        ignores.add((int(a_i), int(b_i)))
        
        price = a_list[a_i-1] + b_list[b_i-1] - discount
        
        if price < result:
            result = price
    except IndexError:
        print('------')
        print(c)
        pass
 
# ---
# result = max(a_list) + max(b_list)
for i, a in enumerate(a_list):
    for j, b in enumerate(b_list):
        if (i+1, j+1) not in ignores:
            price = a + b
            result = price if price < result else result
            
    
print(result)

Submission status: Runtime Error

Solution code:
a, b, m = map(int,str(input()).split())
a_cost_map = map(int,str(input()).split())
a_cost = list(a_cost_map)
b_cost_map = map(int,str(input()).split())
b_cost = list(b_cost_map)

coupons_map = [str(input()).split() for i in range(m)]
coupons_map_all =  [[int(coupons_map[i][t]) for t in range(len(coupons_map[i]))] for i in range(len(coupons_map))]

minimum = min(a_cost) + min(b_cost)
for coupon in coupons_map_all:
    coupon_use = (a_cost[coupon[0]-1] +  b_cost[coupon[1]-1] - coupon[2]) 
    print(coupon_use)
    if minimum > coupon_use:
        minimum = coupon_use
print(minimum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# A 
s = input()

for i in range(0, len(s), 2):
    if len(s) < 2:
        bool = False
        break
    elif s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
s=input()
i=0;
found=False;
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(s[0]=='i'):
	found=False
if(s[1]=='h'):
	found=False

if(found==False):
	print("No")
else:
	print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
target = 'hi'
index == -1
index = S.find(target)
if index > -1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N,M = map(int,read().split())

def solve(N,M):
    if N > M:
        return solve(M,N).T
    H = np.array([[0]], np.int8)
    for i in range(M):
        H = np.tile(H, (2,2))
        H[1<<i:,1<<i:] ^= 1
    H = np.diff(H, axis=0)
    H = np.diff(H, axis=1)
    return (H % 2)[:(1<<N) - 1]

H = solve(N,M)
rows = (''.join(map(str, row)) for row in H)
print('\n'.join(rows))

Submission status: Runtime Error

Solution code:
A,B,M = [int(x) for x in input().split()]
A_list = [int(x) for x in input().split()]
B_list = [int(y) for y in input().split()]
discount = []
min = 10000000
for _ in range(M):
  case = [int(x) for x in input().split()]
  discount.append(case)

min_a = sorted(A_list)[0]
min_b = sorted(B_list)[0]

for i in range(M):
  temp = A_list[discount[i][0]-1] + B_list[discount[i][1]-1] - discount[i][2]
  if temp < min:
    min = temp
    
if min_a + min_b > min:
  print(min)
else:
  print(min_a + min_b)

Submission status: Runtime Error

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: Runtime Error

Solution code:
import re

ptr = ["hi", "hihi", "hihihi", "hihihihi", "hihihihihi"]
str = ["hihi", "hi", "ha" ]

for valuestr in ptr:
  pattern = re.compile(valueptr)
  for valuestr in str:
    res = pattern.search(valuestr)
    if res is not None:
      m = "Yes"
    else:
      m = "No"
    msg = "(入力)" + valuestr + "(判定)" + m
    print(msg)

Submission status: Runtime Error

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: Runtime Error

Solution code:
# A
s = input()

for i in range(0, len(s), 2):
    if s[i] == 'h' and s[i+1] == 'i':
        bool = True
    else:
        bool = False
        break
        
print('Yes' if bool else 'No')

Submission status: Runtime Error

Solution code:
S=input()
W=S.split("hi")
A = W.remove('')

if A==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import S

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: Runtime Error

Solution code:
s=str(inputs())
tmp = s.replace('hi','')
if tmp=='':
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = S

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()

flag = True
for i in range(0, 11, 2):#len(S), 2):
    if len(S) % 2 == 0:
        if S[i] + S[i + 1] == 'hi':
            if i + 2 == len(S):
                break
            else:
                pass
    else:
        if S[i] + S[i + 1] == 'hi':
           pass
        if i + 1 == len(S):
            flag = False
            break
        else:
            flag = False
            break

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

Submission status: Runtime Error

Solution code:
s = list(input())
flag = True
ans = True
if len(s) == 1 || 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: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
if n<=1:
  print("No")
  exit()
for i in range(n):
  if i!=n and s[i]=="h":
    if s[i+1]!="i":
      print("No")
      exit()
  elif i!=0 and s[i]=="i":
    if s[i-1]!="h":
      print("No")
      exit()
  elif s[i]!="h" or s[i]!="i":
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
disc = []
for i in range(M):
  disc.append(list(map(int,input().split())))
ans = a[0] + b[0]
for i in range(M):
  ans = min(a[disc[i][0]-1] + b[disc[i][1]-1] - disc[i][2], ans)     
    
print(ans)

Submission status: Runtime Error

Solution code:
s=input()
n=len(s)
for i in range(n):
  if i!=n and s[i]=="h":
    if s[i+1]!="i":
      print("No")
      exit()
  elif i!=0 and s[i]=="i":
    if s[i-1]!="h":
      print("No")
      exit()
  elif s[i]!="h" or s[i]!="i":
      print("No")
      exit()
print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
l = len(S)


count = 0

if(S[0] == 'h'):
    count = 1
    moji = 'h'
    if S[1] == 'i':
        count = 2
        moji = 'hi'
        if S[2] == 't':
            count =3
            moji = 'hit'
            if S[3] == 'a':
                count = 4
                moji = 'hita'
                if S[4] == 'c':
                    count = 5
                    moji = 'hitac'
                    if S[5] == 'h':
                        count = 6
                        moji = 'hitach'
                        if S[6] == 'i':
                            count = 7
                            moji = 'hitachi'
ans = 'No'                        
if count == 1:
    if S == 'h' * l:
        ans = 'Yes'
   
if count == 2:
    if S == 'hi' * int(l/2):
        ans = 'Yes'     

if count == 3:
    if S == 'hit' * int(l/3):
        ans = 'Yes' 
        
if count == 4:
    if S == 'hita' * int(l/4):
        ans = 'Yes' 
        
if count == 5:
    if S == 'hitac' * int(l/5):
        ans = 'Yes'
        
if count == 6:
    if S == 'hitach' * int(l/6):
        ans = 'Yes'
        
if count == 7:
    if S == 'hitachi' * int(l/7):
        ans = 'Yes' 
        
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
l = len(S)

count = 0

if(S[0] == 'h'):
    count = 1
    moji = 'h'
    if S[1] == 'i':
        count = 2
        moji = 'hi'
        if S[2] == 't':
            count =3
            moji = 'hit'
            if S[3] == 'a':
                count = 4
                moji = 'hita'
                if S[4] == 'c':
                    count = 5
                    moji = 'hitac'
                    if S[5] == 'h':
                        count = 6
                        moji = 'hitach'
                        if S[6] == 'i':
                            count = 7
                            moji = 'hitachi'
ans = 'No'                        
if count == 1:
    print(1)
    if S == 'h' * l:
        ans = 'Yes'
   
if count == 2:
    if S == 'hi' * int(l/2):
        ans = 'Yes'     

if count == 3:
    if S == 'hit' * int(l/3):
        ans = 'Yes' 
        
if count == 4:
    if S == 'hita' * int(l/4):
        ans = 'Yes' 
        
if count == 5:
    if S == 'hitac' * int(l/5):
        ans = 'Yes'
        
if count == 6:
    if S == 'hitach' * int(l/6):
        ans = 'Yes'
        
if count == 7:
    if S == 'hitachi' * int(l/7):
        ans = 'Yes' 
        
print(ans)

Submission status: Runtime Error

Solution code:
a=input()
list_1=list(a)
length=len(list_1)
count=0
for k in range(0,length,2):
  if list_1[k]=='h' and list_1[k+1]=='i':
    count+=2
    if count==length:
      print("Yes")
      break
    else:
      continue
  else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = str(input())
n = 0
m = 0
if S[n]!='h':
  while S[n]!='h':
    n+=1
    m+=1
while len(S) > n:
    if (n+m) % 2 == 1 and S[n] != 'i':
        print('No')
        exit()
    elif (n+m) % 2 == 0 and S[n] != 'h':
        print('No')
        exit()
    n += 1

print('Yes')

Submission status: Runtime Error

Solution code:
s = list(map(input().split()))
ans = "Yes"
for i in range(len(s)):
  if i%2 == 0 and s[i] != "h":
    ans = "No"
  elif i%2 == 1 and s[i] != "i":
    ans = "No"
if len(s)%2 == 1:
  ans = "No"
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
if len(S) == 1:
  print("No")
else:
  while (len(S) != 0):
    if S[0] == 'h' and S[1] == 'i':
      S = S[2:]
    else:
      break
  if len(S) != 0:
    print("No")
  else:
    print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
S = input()
a = []
count = 0

for i in range(0, len(S)):
    a.append(S[i])

for k in range(0, len(S)):
    if k % 2 == 0:
        if S[k] == "h":
            if S[k+1] == "i":
                count += 1
            else:
                print("No")
                sys.exit()
        else:
            print("No")
            sys.exit()
    else:
        pass

if len(S) % 2 == 0:
    if count % 2 == 0:
        print("Yes")
    else:
        pass
else:
    if count % 2 == 1:
        print("Yes")
    else:
        pass

Submission status: Runtime Error

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: Runtime Error

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

if num % 2 == 0:
    b = 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: Runtime Error

Solution code:
S = input();
while (len(S) != 0):
  if S[0] == 'h' and S[1] == 'i':
    S = S[2:]
  else:
    break
if len(S) != 0:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S=str(input())
A= int(S.count('hi'))
B= int(len(S))

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

Submission status: Runtime Error

Solution code:
s = input()
s = list(s)

a = 0
if s[-2] == 'h' and s[-1] == 'i':
  a += 1
  
if len(s) == 2:
  if s[0] == 'h' and s[1] == 'i':
    a += 1
elif len(s) > 2:
  for i in range(len(s)-2):
    if s[i] == 'h':
      if s[i+1] == 'i' and s[i+2] != 'i':
        a += 1
        break
    
if a >= 1:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
n = 0
m = 0
if S[n]!='h':
  while S[n]!='h':
    n+=1
    m+=1
while len(S) > n:
    if n+m % 2 == 1 and S[n] != 'i':
        print('No')
        exit()
    elif n+m % 2 == 0 and S[n] != 'h':
        print('No')
        exit()
    n += 1

print('Yes')

Submission status: Runtime Error

Solution code:
S=str(input())
A= int(S.count('hi'))
B= int(len(S))

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

Submission status: Runtime Error

Solution code:
S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0:
        a = False 
        break
    else:
        if i %2=0 and (S[i] != 'h' or S[i+1] != 'i'):
            a = False

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

Submission status: Runtime Error

Solution code:
s=str(input())
if len(s)%2==1:
    print("No")
else:
    is_hitachi=1
    for i in range(int(len(s)/2)):
        if s[2i]!="h" or s[2i+1]!="i":
            is_hitachi=0
            break
    if is_hitachi==1:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()

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

if flag==0 and len(S)>=2:
    print('Yes')
elif flag==1 or len(S)<2:
    print('No')

Submission status: Runtime Error

Solution code:
s = input()
n = len(s) // 2
lst = [(i + j) for (i, j) in zip(s[::2], s[1::2])]

for i in range(n):
    if lst[i] == 'hi':
        check = 1
    else:
        check = 0
        break

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

Submission status: Runtime Error

Solution code:
s = input()
s_len = len(s)
if s_len % 2:
  print("No")
else:
  prev = 0
  count = 0
  for i in range(1, (s_len//2)+1):
    if [prev:i*2] != "hi":
      print("No")
      break
    else:
      count += 1
      prev = i * 2
  if count == s_len:
    print("Yes")

Submission status: Runtime Error

Solution code:
# import re
s = input()
# m = re.fullmatch(hi{1,10},s):
# if m = "None":
#     print("No")
# else:
#     print("Yes")

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

Submission status: Runtime Error

Solution code:
s = input()
s_len = len(s)
if s_len % 2:
  print("No")
else:
  prev = 0
  count = 0
  for i in range(1, (s_len//2)+1):
    if [prev:i*2] != "hi":
      print("No")
      break
    else:
      count += 1
  if count == s_len:
    print("Yes")

Submission status: Runtime Error

Solution code:
s=str(input())
if len(s)%2==1:
    print("No")
else:
    is_hitachi=1
    for i in range(len(s)/2):
        if s[2i]!="h" or s[2i+1]!="i":
            is_hitachi=0
            break
    if is_hitachi==1:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = list(input())

for i in range(len(S) - 1):
    if S[i] == "h" and S[i + 1] == "i" and S[i + 2] != "i":
        print("Yes")
        exit()

print("No")

Submission status: Runtime Error

Solution code:
S = input()
if S[:2]=="hi" and S[2] != "i":
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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: Runtime Error

Solution code:
S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0 :
        a = False 
        break
    else:
        if S[i/2] != 'h' or S[i/2 +1] != 'i':
            a = False
            break

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

Submission status: Runtime Error

Solution code:
S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0 :
        a = False 
        break
    else:
        if S[i/2] != 'h' or S[i/2 +1] != 'i':
            a = False
            break

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

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

Solution code:
S = input()
a = True
for i in range(len(S)):
    if len(S) % 2 != 0 :
        a=False 
        break
    else:
        if S[i/2] != 'h' or S[i/2 +1] !- 'i':
            a=False
            break

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

Submission status: Runtime Error

Solution code:
s = input()
s = list(s)

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
S = input()
a = True
for i in range(len(S)):
    if len(S)%2==0 :a=False break
    else:
        if S[i/2] != 'h' or S[i/2 +1] !- 'i':
            a=False
            break

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

Submission status: Runtime Error

Solution code:
S=input()
TF=1
if len(S)%2==0 and len(S)>=2:
    for i in range(len(S)/2):
        if S[2*i]!='h' or S[2*i+1]!='i':
            TF=0
        else:
            TF*=1
else:
    TF=0

if TF==0:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s=input()
f=1
i=0
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: Runtime Error

Solution code:
TF=1
if len(S)%2==0 and len(S)>=2:
    for i in range(len(S)/2):
        if S[2*i]!='h' or S[2*i+1]!='i':
            TF=0
        else:
            TF*=1
else:
    TF=0

if TF==0:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
s = input()

i = 0
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: Runtime Error

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")
    l=S[::2];count=0;p=S[1::2]
    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: Runtime Error

Solution code:
S = input()

ans = "No"
for i in range(1:6):
    if S == "hi"*i:
        ans="Yes"
print(ans)

Submission status: Runtime Error

Solution code:

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

Submission status: Runtime Error

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


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

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

Submission status: Runtime Error

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(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: Runtime Error

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

while cnt<len(s):
  if len(s)==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: Runtime Error

Solution code:
S = str(int())

if S%2 == 0:
  tes = "hi"*int((len(S)/2))
  if S ==tes:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
S=input()
TF=1
if len(S)%2==0:
    for i in range(len(S)/2):
        if S[2*i]!='h' or S[2*i+1]!='i':
            TF=0
        else:
            TF*=1
else:
    TF=0

if TF==0:
    print('No')
else:
    print('Yes')