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:
s = input().split('i')

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

for j in h:
  if j =='h' and i == '':
    ans = 'Yes'
  
print(ans)

Submission status: Runtime Error

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

h = s[:len(s)-1]
i = s[len(s)-1]
ans = 'No'
for j in h:
  if j =='h' and i == '':
    ans = 'Yes'
  
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
sS = s.replace(hi, 'H')
if 'H' in sS:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = input()
sS = s.replace('hi', 'H')
slist = sorted(sS)
kaisu = alist.count('H')
if kaisu >= 1:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
count = 0
out = 0
for i in range(len(S_list)-1):
    #print(i)
    if S_list[i]=='h':
        if S_list[i+1]=='i':    
            if i+2 > len(S_list)-1:
                count += 1                
            else:
                if S_list[i+2]=='i':
                    out += 1

if count >0 and out ==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()

S_list = list(S)

for i in range(len(S_list)-1):
    if S_list[i]=='h':
        if S_list[i+1]=='i':    
            try:
                letter = S_list[i+2]
            except IndexError:
                pass
                if letter!='i':                    
                    print('Yes')
                    break
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()

S_list=list(S)
for i in range(S_list):
  if S_list[i]=='h':
    if S_list[i+1] == 'i':
      if S_list[i+1] != 'i':
        print('Yes')
    
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = input()
if s.search("hi") != -1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S=input()
if S.count(hi)>=1:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
K=4000
S=[input()for i in R(3)]
A,B,C=S
a,b,c=len(A),len(B),len(C)
def F(S,T):
 R=[1]*(K*2+1)
 for i in R(-len(T),len(S)):
  for j in range(max(i,0),min(len(S),len(T)+i)):
   if S[j]!=T[j-i]and S[j]!="?"and T[j-i]!="?":
    R[i]=0
    break
 return R
AB=F(A,B)
AC=F(A,C)
BC=F(B,C)
i=K*3
for i in range(-K,K+1):
 if A[i]!=0:
  for i in range(-K,K+1):
   if A[c]==0 or B[i-i]==0:
    m=min(m,max(b+b,c+c,a)-min(b,c,0))
print(m)

Submission status: Runtime Error

Solution code:
K=4000
S=[input()for i in R(3)]
A,B,C=S
la,lb,lc=len(A),len(B),len(C)
def F(S,T):
 R=[1]*(K*2+1)
 for i in R(-len(T),len(S)):
  for j in range(max(i,0),min(len(S),len(T)+i)):
   if S[j]!=T[j-i]and S[j]!="?"and T[j-i]!="?":
    R[i]=0
    break
 return R
AB=F(A,B)
AC=F(A,C)
BC=F(B,C)
mi=K*3
for ib in range(-K,K+1):
 if AB[ib]!=0:
  for ic in range(-K, K+1):
   if AC[ic]==0 or BC[ic-ib]==0:
    mi=min(mi,max(ib+lb,ic+lc,la)-min(ib,ic,0))
print(mi)

Submission status: Runtime Error

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

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:
S=input()
if S==hi orS==hihi or S==hihihi or S==hihihihi or S==hihihihihi:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=str(input())

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

Submission status: Runtime Error

Solution code:
import sys

s=string(input())

for i in range(len(s)-1):
  if s[i]=="h" and s[i+1]=="i":
    print("Yes")
    sys.exit()
print("No")

Submission status: Runtime Error

Solution code:
s = input()

if s // 2 ==1:
	print('Np')
	exit()

if s == "hi"* (s // 2):
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
s=input()
for i in range(len(s)):
  if i == len(s)-1:
    print('No')
    break
  if s[i]=='h':
    if s[i+1]=='i':
      if i == len(s):
        print('Yes')
        break
      else:
        if s[i+2]!='a' and s[i+2]!='i' and s[i+2]!='u' and s[i+2]!='e' and s[i+2]!='o':
              print('Yes')
              break

Submission status: Runtime Error

Solution code:
def getMinSumPrice(x,y):
    return int(min(x)) + int(min(y))

def getMinCouponPrice(z):
    tmp = []
    for Arr in z:
        if int(Arr[0]) + int(Arr[1]) > int(Arr[2]):
            tmp.append(int(Arr[0]) + int(Arr[1]) - int(Arr[2]))
    return min(tmp)

A = input().split(" ")
a = input().split(" ")
b = input().split(" ")
C = []
for i in range(0, int(A[2])):
  val = input().split(" ")
  if val:
    C.append(val)

if getMinSumPrice(a, b) > getMinCouponPrice(C):
    print(getMinCouponPrice(C))
else:
    print(getMinSumPrice(a, b))

Submission status: Runtime Error

Solution code:
text = input()

def checkHitachi(text):
  if (len(text)%2 != 0): # odd length
    return 'No'
  # even length
  for i in range(0, len(text), 2):
    if !((text[i]=='h') and (text[i+1]=='i')):
      return 'No'

  return 'Yes'
 
print(checkHitachi(text))

Submission status: Runtime Error

Solution code:
text = input()

check_i = False

def checkHitachi(text):
  for i in range(len(text)):
    if check_i:
      if (text[i] != 'i'):
        return 'No'
      else:
        check_i = False
    else:
      if (text[i] != 'h'):
        return 'No'
      else:
        check_i = True
  return 'Yes'

print(checkHitachi(text))

Submission status: Runtime Error

Solution code:
s=str(input())
a=len(s)
b=[hi,hihi,hihihi,hihihihi,hihihihihi]
if a%2!=0:
  print('No')
elif s in b:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s=str(input())
a=len(s)
if a%2!=0:
  print('No')
elif s=[hi,hihi,hihihi,hihihihi,hihihihihi]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=list(input())

for i in range(10):
  if s[i]=='h' and s[i+1]=='i':
    print('Yes')
    exit()
  
print('No')

Submission status: Runtime Error

Solution code:
s=list(map(int,input().split()))

for i in range(10):
  if s[i]==h and a[i+1]==i:
    print('Yes')
    exit()
    
print('No')

Submission status: Runtime Error

Solution code:
import sys;input=sys.stdin.readline
n=int(input())
s=input()
num=2**(n-1).bit_length()
def segfunc(x,y):return x|y
seg=[0]*(2*num-1)
for i in range(n):seg[i+num-1]=2**(ord(s[i])-97)
for i in range(num-2,-1,-1):seg[i]=segfunc(seg[2*i+1],seg[2*i+2])
def update(i,x):
  i+=num-1;seg[i]=x
  while i:i=(i-1)//2;seg[i]=segfunc(seg[i*2+1],seg[i*2+2])
def query(l,r):
  l+=num-1;r+=num-1
  if l==r:return seg[l]
  s=seg[l];l+=1
  while r-l>1:
    if ~l%2:s=segfunc(seg[l],s)
    if r%2:s=segfunc(seg[r],s);r-=1
    l//=2;r=(r-1)//2
  if l==r:return segfunc(s,seg[l])
  return segfunc(s,segfunc(seg[l],seg[r]))
for _ in range(int(input())):
  quer=input().split()
  if quer[0]=="1":
    _,i,c=quer
    update(int(i)-1,2**(ord(c)-97))
  else:
    _,l,r=quer
    print(sum(map(int,bin(query(int(l)-1,int(r)-1))[2:])))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = Input()
if s.count('hi') is 0:
    print('No')
print('Yes')

Submission status: Runtime Error

Solution code:
S = raw_input()

length = len(S)
if length % 2 == 0:
  if n.count('hi')==length/2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
lines = []
line = input()
s = line.split(' ')
entries = int(s[2]) + 2
for i in range(entries+1):
    lines.append(line.split(' '))
    if i < entries:
        line = input()

discounts = []
for idx, line in enumerate(lines):
    if idx == 0:
        A = line[0]
        B = line[1]
        M = line[2]
    elif idx == 1:
        refrigerators = line
    elif idx == 2:
        microwaves = line
    else:
        discounts.append(line)

ref_reg = int(10 ** 5)
for r in refrigerators:
    reg = int(r)
    if ref_reg > reg:
        ref_reg = reg

ref_mic = int(10 ** 5)
for m in microwaves:
    mic = int(m)
    if ref_mic > mic:
        ref_mic = mic

ref_min = ref_reg + ref_mic
for discount in discounts:
     d = int(refrigerators[int(discount[0])-1]) + int(microwaves[int(discount[1])-1]) - int(discount[2])
     if d < ref_min:
         ref_min = d       
         
print(ref_min)

Submission status: Runtime Error

Solution code:
S = input()
if 'hi' in S:
    print 'Yes'
elif:
    print 'No'

Submission status: Runtime Error

Solution code:
import itertools
import sys
input = sys.stdin.readline
 
n,t = map(int,input().split())
l_a0 = []
l_a1 = []
 
for i in range(n):
    tmp = list(map(int,input().split()))
    if tmp[0] == 0:
        l_a0.append(tmp[1]+1)
    else:
        l_a1.append(tmp)
 
l_a0.sort()
l_a1.sort(reverse=True, key=lambda x: x[0]/(x[1]+1))

dp = [t*10] * 30 
dp[0] = 0

for a, b in l_a1:
        for num in range(28, -1, -1):
            candidate = (dp[num]+1) * (a+1) + b
            if candidate < dp[num+1]:
                dp[num+1] = candidate
dp = [i for i in dp if i <= t]

ans = [0]
for i in range(len(dp)):
    spendtime = dp[i]
    tmp = i
    for j in range(len(l_a0)):
        if spendtime + l_a0[j] <= t:
            spendtime += l_a0[j]
            tmp += 1
        else:
            break
    ans.append(tmp)
    
print(max(ans))

Submission status: Runtime Error

Solution code:
impotr re
s = input()

pattern = 'hi'
m = re.search(pattern, s)
if m:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:

from copy import deepcopy
string_in = input("input : ")
check_str = "hi"

max_count = string_in.count(check_str)
check_obj = ["hi"*i for i in range(1,max_count+1)][::-1]
string_in4 = deepcopy(string_in)
count = 0
for i in range(len(check_obj)):
  i_str = str(check_obj[i])
  string_in4 = string_in4.replace(i_str, '%d'%(i))
  count += string_in4.count('%d'%(i))

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

Submission status: Runtime Error

Solution code:
s_=input()
f=1
if len(s)>1:
    for i in range(len(s)-1):
        if s[i]=='h':
            if s[i+1]!='i':
                f=-1
                break
        if s[i]=='i':
            if s[i+1]!='h':
                f=-1
                break
else:
    f==-1
if f==1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s=input()
f=1
if len(s)>1:
    for i in range(len(s)-1):
        if s[i]=='h':
            if s[i+1]!='i':
                f=-1
                break
        if s[i]=='i':
            if s[i+1]!='h':
                f=-1
                break
else:
    f=-1
if f=1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s=input()
f=1
if len(s)>1:
    for i in range(len(s)-1):
        if s[i]=='h':
            if s[i+1]!='i':
                f=-1
                break
            if s[i]=='i':
                if s[i+1]!='h':
                    f=-1
                    break
else:
    f=-1
if f=1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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:
a=int(input())
b=int(input())
print(6-(a+b))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
t = len(S)
a = 0
for i in range(t-1):
    if s[i] == "h" and s[i+1] == "i":
        a += 1
if a >= 1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

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

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:
list_num = input().split(" ") #A,B,M
list_ref = input().split(" ") #冷蔵庫の値段
list_ren = input().split(" ") #レンジの値段
list2 = [] #割引できるやつの組み
for i in range(int(list_num[2])):
    list_c = input().split(" ")
    list2.append(list_c)
A = int(list_num[0])
B = int(list_num[1])
M = int(list_num[2])
 
#割引なしで総当たり
list_price = []
for i in range(A):
    for j in range(B):
        list_price.append(int(list_ref[i]) + int(list_ren[j]))
 
#割引きを総当たり
for k in range(M):
    price = int(list_ref[int(list2[k][0])-1]) + int(list_ren[int(list2[k][1])-1]) - int(int(list2[k][2])-1) - 1
    list_price.append(price)
 
 
print(min(list_price))

Submission status: Runtime Error

Solution code:
S = input()

for s in S:
    if s == 'h':
        Flag = True
    elif s == 'i' and Flag == True:
        Flag = False
    else:
        Flag = False
        print('No')
        exit()

print('Yes')

Submission status: Runtime Error

Solution code:
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:
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:
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:
if S=="hi":
  print("Yes")
  elsif S=="hihi":
    print("Yes")
    elsif S=="hihihi":
      print("Yes")
      elsif S=="hihihihi":
        print("Yes")
        elsif S=="hihihihihi":
          print("Yes")
          else print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
S = input()
result = ["Yes" if (1 <= len(S) <= 10) and (S[-2] == "h") and (S[-1] == "i") else "No"]
p = list(map(print, result))

Submission status: Runtime Error

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

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:
#!/usr/bin/python
# coding: UTF-8

def main():
    A,B,M = list(map(int, input().split(' ')))
    a_list = list(map(int, input().split(' ')))
    b_list = list(map(int, input().split(' ')))

    price_list = 2*10**5
    for i in range(M):
        temp = list(map(int, input().split(' ')))
        if price_list > a_list[temp[0]-1] + b_list[temp[1]-1] - temp[2]:
            price_list = a_list[temp[0]-1] + b_list[temp[1]-1] - temp[2]

    lower = min(a_list) + min(b_list)
    if lower < price_list:
        print(lower)
    else:
        print(price_list)

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
S = input()

while len(S) >= 2:
    if S[0:2]== 'hi':
        S==[2:]
    else:
        break
if len(S)==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
S = input()

while len(S) >= 2:
    if S[0:1]== 'hi':
        S==[2:]
    else:
        break
if len(S)==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys

def main(arg):

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

if __name__=='__main__':
    main(sys.argv[1:])

Submission status: Runtime Error

Solution code:
x=input()
if x == 'hi':
	print('Yes')
else if x == 'hihi':
	print('Yes')
else if x == 'hihihi':
	print('Yes')
else if x == 'hihihihi':
	print('Yes')
else if x == 'hihihihihi':
	print('Yes')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
x=input()
if x == 'hi'
	print('Yes')
else if x == 'hihi'
	print('Yes')
else if x == 'hihihi'
	print('Yes')
else if x == 'hihihihi'
	print('Yes')
else if x == 'hihihihihi'
	print('Yes')
else
	print('NO')

Submission status: Runtime Error

Solution code:
x=input()
x1=len(x)
x2 = x1 / 2
if x1 %2 == 0
	if "hi"*x2 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
x=input()
x1=len(x)
if x1 %2 == 0
	if "hi"*x1 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")

Submission status: Runtime Error

Solution code:
x=input()
x1=len(x)
if x1 %2 == 0
	print("yes")
else
	print("no")

Submission status: Runtime Error

Solution code:
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))
colorsCount = counts[0]
hotsCount = counts[1]
ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = max(colors)
max_color_idx = colors.index(max_color)
max_hots = max(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
  
print(str(minPrice))

Submission status: Runtime Error

Solution code:
*s, = input()

ans = "Yes"
for i in range(0, len(s), 2):
    if s[i] != "h" or s[i+1] != "i":
        ans = "No"
        break

print(ans)

Submission status: Runtime Error

Solution code:
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))
colorsCount = counts[0]
hotsCount = counts[1]
ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = max(colors)
max_color_idx = colors.index(max_color)
max_hots = max(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
print(str(minPrice))

Submission status: Runtime Error

Solution code:
s=input()
print(len(s))
for i in range(len(s)):
    if s[i]=="h":
        if i<len(s)-1:
            if s[i+1]=="i":
                print("Yes")
                break
	print("No")

Submission status: Runtime Error

Solution code:
a,b,m=map(int, input().split())
list_a=[ int(i)  for i in input().split()]
list_b=[ int(i)  for i in input().split()]
x,y,c=([],[],[])
for i in range(m):
    s=list(map(int, input().split()))
    x+=[s[0]]
    y+=[s[1]]
    c+=[s[2]]
print(min([ list_a[x[i]-1] + list_b[y[i]-1] - c[i]   for i in range(len(c))]+[min(list_a)+min(list_b)]))

Submission status: Runtime Error

Solution code:
S = input()
S_len = len(S)
if S_len % 2 != 0:
    print("No")
else:
    set_num = int(S_len // 2)
    for i in range(set_num):
        if S[i*2] != "h" or S[i*2 +1] != "i":
            hitachi? = False
            break
        else:
            hitachi? = True
    if hitachi? = False:
        print("No")
    elif hitachi? = True:
        print("Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
 
for i in range(len(s)):
  if s[i]=="h":
    if i<len(s):
      s[i+1]=="i":
        print("yes")
print("no")

Submission status: Runtime Error

Solution code:
s=input()

for i in range(len(s):
               if s[i]=="h":
                if s[i+1]=="i":
                 print("yes")
                 exit()

Submission status: Runtime Error

Solution code:
na,nb,nm =  map(int, (input().split()))

a = list(map(int, input().split()))
b = list(map(int, input().split()))

mina = a[0]
minb = b[0]
for i in range(na):
    if a[i] < mina :
        mina = a[i]
for j in range(nb):
    if b[j] < minb :
        minb = b[j]
min = mina + minb

#  m入力
for k in range(nm):
    i,j,disc = map(int, input().split())
    if min > a[i-1]+b[j-1]-disc:
        min = a[i-1]+b[j-1]-disc

print(min)

Submission status: Runtime Error

Solution code:
na,nb,nm =  map(int, (input().split()))

# m 初期化
# m = [[0] * 3 for i in range(nm)]
d = [[0] * nb for i in range(na)]
#print(d)

a = list(map(int, input().split()))
b = list(map(int, input().split()))
#  print (a,b)

#  m入力
for k in range(nm):
    i,j,disc = map(int, input().split())
    if d[i][j] < disc:
        d[i][j] = disc
#print(d)

best = a[0] + b[0]

for i in range(na):
    for j in range(nb):
        price = a[i] + b[j] - d[i][j]
        if best > price:
            best = price

print(best)

Submission status: Runtime Error

Solution code:
na,nb,nm =  map(int, (input().split()))

# m 初期化
m = [[0] * 3 for i in range(nm)]
d = [[0] * nb for i in range(na)]
#print(d)

a = list(map(int, input().split()))
b = list(map(int, input().split()))
#  print (a,b)

#  m入力
for k in range(nm):
    i,j,disc = map(int, input().split())
    d[i][j]=disc

best = a[0] + b[0]

for i in range(na):
    for j in range(nb):
        price = a[i] + b[j] - d[i][j]
        if best > price:
            best = price

print(best)

Submission status: Runtime Error

Solution code:

S=list(input())
while len(S)>0:
    if S[0] == 'h' and S[1] == 'i':
        S.remove('h')
        S.remove('i')
    else:   
        break

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

Submission status: Runtime Error

Solution code:
A, B, M = list(map(int, input().rstrip().split()))
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))

cost=[]
for _ in range(M):
    x, y, c = list(map(int, input().rstrip().split()))
    tot = a[x-1] + b[y-1] - c
    cost.append(tot)
    
cost.append(min(a)+min(b))
print(min(cost))

Submission status: Runtime Error

Solution code:
inp=list(map(int,input().split(" ")))
N=inp[0]
T=inp[1]+0.5

a=[0]*N
b=[0]*N
for i in range(N):
    inp=list(map(int,input().split(" ")))
    a[i]=inp[0]
    b[i]=inp[1]


time=0
get =0

while(1):
    time+=1
    if(time>T or len(a)==0):
        break
    need=list(map(lambda x,y:x*time+y,a,b))
    mini=min(need)
    time+=mini
    go=[i for i, x in enumerate(need) if x == mini]#get list to minimum
    gomin=[]
    for i in range(len(go)):#make list a
        gomin.append(a[go[i]])
    go=gomin.index(max(gomin))#find a minimum index
    del a[go]
    del b[go]
    if(time>T):
        break
    get+=1

print(get)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
r,p,m=range,print,min
n,a,b=[list(map(int,input().split()))for i in r(3)]
l=[]
for i in r(n[2]):
  x,y,z=map(int,input().split())
  l.append(a[x-1]+b[y-1]-z)
p(m([m(a)+m(b),m(l)]))

Submission status: Runtime Error

Solution code:
S=str(input())
if len(S)%2!=0:
	print("No")
else:
	for i in range(len(S)):
		if i%2==0:
			if S[i]!='h':
				print("No")
                return 
        else:
			if S[i]!='i':
				print("No")
                return
        if i==len(S)-1:
			print("Yes")

Submission status: Runtime Error

Solution code:
def main():
    S = list(input())
    k = 0
    ans = False
    while True :
        if k >= len(S):
            ans = True
            break
        elif S[k] + S[ k + 1] != "hi":
            break
        else :
            k += 2
    if ans : print("Yes")
    else: print("No")
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    S = list(input())
    k = 0
    ans = False
    while True :
        if k == len(S):
            ans = True
            break
        elif S[k] + S[ k + 1] != "hi":
            break
        else :
            k += 2
    if ans : print("Yes")
    else: print("No")
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
s=str(input())
n=len(s)
ans=1
for i in range(n):
    if s[i]!='h' or s[i+1]!='i':
        a=0
    i+=1

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

Submission status: Runtime Error

Solution code:
str = input()
count  = str.count("hi" != True)
if count > 0 :
  print("No")
else :
  print("Yes")

Submission status: Runtime Error

Solution code:
s = input()

if set(s) == {'h', 'i'}:
    print("Yes")
else:z
    print("No")

Submission status: Runtime Error

Solution code:
str = input()
count  = str.count("hi")
if count > 0 :
  print("Yes")
else 
  print("No")

Submission status: Runtime Error

Solution code:
if S[0:2]=='hi':
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

ans = "Yes"
for i in range(0, 9, 2):
    if s[i] + s[i+1] != "hi":
        ans = "No"
        break

print(ans)

Submission status: Runtime Error

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

ans = "Yes"
for i in range(0, 11, 2):
    if s[i] + s[i+1] != "hi":
        ans = "No"
        break

print(ans)

Submission status: Runtime Error

Solution code:
str = input()
count  = str.count("hi")
if count > 1 :
  print("Yes")
else 
  print("No")

Submission status: Runtime Error

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

ans = "Yes"
for i in range(0, len(s), 2):
    if s[i] + s[i+1] != "hi":
        ans = "No"

print(ans)

Submission status: Runtime Error

Solution code:
s=input()

if "h" in s:
    flag = False
    for i in range(len(s)-1):
        if s[i]=="h":
            if s[i+1]=="i":
                flag=True
            else:
                flag=False

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

Submission status: Runtime Error

Solution code:
S = input().strip()
s = str.lower(S)
target = 'hi'
if target = 'hi':
    print('Yes')
elif target = 'hihi':
    print('Yes')
elif target = 'hihihi':
    print('Yes')    
elif target = 'hihihihi':
    print('Yes')
elif target = 'hihihihihi':
    print('Yes')
else
    print('No')

Submission status: Runtime Error

Solution code:
s=input()

if "h" in s:
    flag = True
    for i in range(len(s)-1):
        if s[i]=="h":
            if s[i+1]!="i":
                flag=False

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

Submission status: Runtime Error

Solution code:
import sys

def resolve():
    input = sys.stdin.readline
    A, B, M = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    grid=[list(map(int,input().split())) for i in range(M)]

    res = min(a) + min(b)

    for x, y, c in grid:
        res = min(res, a[x-1]+b[y-1]-c)

    print(res)
    
resolve()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n,T=map(int,input().split())
ck=[]
times=[]
l=[]
t=0
s=0
count=0
for i in range(n):
    ck=list(map(str,input().split()))

nck=sorted(ck,reverse=True)
for i in range(n):
    for i in range(n):
        t+=1
        s=t*int(nck[i-1][0])+int(nck[i-1][1])
        t+=s
        count+=1
        if t>T:
            t-=s
            n-=1
            times.append(count)
            nck.remove(nck[0])
            break
print(max(times))