Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = (int)(input())
b = (int)(input())

if (a > 8 or b > 8):
    print(":(")
else:
    print("Yay!")

Fixed submission:
text = input().split()
a = (int)(text[0])
b = (int)(text[1])

if (a > 8 or b > 8):
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
ans = [10 for i in range(n)]
flag = 0
for i in range(m):
    s,c = map(int, input().split())
    if s==1 and c==0:
        flag = -1
    if ans[s-1]!=10 and ans[s-1]!=c:
        flag = -1
    ans[s-1] = c
#print(ans)
if ans[0]==10:
    ans[0]=1
    if ans[1]==10:
        ans[1]=1
        if ans[2]==10:
            ans[2]=1
for i in range(n):
    if ans[i]==10:
        ans[i]=0
map_ans = map(str, ans)
answer =''.join(map_ans)

print(-1 if flag==-1 else answer)

Fixed submission:
n,m = map(int, input().split())
ans = [10 for i in range(n)]
flag = 0
for i in range(m):
    s,c = map(int, input().split())
    if s==1 and c==0 and n!=1:
        flag = -1
    if ans[s-1]!=10 and ans[s-1]!=c:
        flag = -1
    ans[s-1] = c
#print(ans)
if ans[0]==10 and n!=1:
    ans[0]=1
    if n==2 or n==3:
        if ans[1]==10:
            ans[1]=0
            if n==3:
                if ans[2]==10:
                    ans[2]=0
for i in range(n):
    if ans[i]==10:
        ans[i]=0
map_ans = map(str, ans)
answer =''.join(map_ans)

print(-1 if flag==-1 else answer)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
ans = 'APPROVED'
for a in A:
    if a % 2 == 0:
        if a % 3 != 0 and a % 5 != 0:
            ans = 'DENIED'
            exit()
print(ans)

Fixed submission:
print("Yes" if len(set(map(int, input().split())))==2 else "No")
Buggy python submission (verdict: Runtime Error):
print(800*int(input())-200*(int(input())//15))

Fixed submission:
n = int(input())
print(800*n-200*(n//15))

Buggy python submission (verdict: Runtime Error):
print(800*int(input())-200*(n//15))

Fixed submission:
n = int(input())
print(800*n-200*(n//15))
Buggy python submission (verdict: Time Limit Exceeded):

import itertools
import numpy as np
from numba import jit


@jit
def gcd(a, b):
    if a < b:
        a, b = b, a
    if (a % b == 0):
        return b
    return(gcd(a % b, b))


def gcd3(a, b, c):
    return gcd(gcd(a, b), c)


N = input()
a = [int(N) for k in range(3)]
range_list = list(map(lambda x: range(1, x+1), a))
prd_list = itertools.product(*range_list)

# prd_set = ((s[0] + 1, ))

gcds = [gcd3(*prd) for prd in prd_list]

s = np.sum(gcds)

print(s)

Fixed submission:
#!/usr/bin/env python3

from math import gcd


t = int(input())
ans = 0
for i in range(1, t + 1):
    for j in range(1, t + 1):
        r = gcd(i, j)

        for k in range(1, t + 1):
            ans += gcd(r, k)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = input()
S = input()
sli = [c for c in S]

nR = sli.count('R')
nG = sli.count('G')
nB = sli.count('B')

dx = 1
ng = 0
for i, c in enumerate(sli):
    rl = []
    dx = 1

    a = int(len(sli) / 2)
    rl = [(i, i+dx, i+dx*2)
          for dx in range(len(sli)) if dx * 2 + i < len(sli)]

    for ind in rl:
        if len(set([sli[ind[0]], sli[ind[1]], sli[ind[2]]])) == 3:
            ng += 1


n = nR * nG * nB - ng
print(str(n))


Fixed submission:
#!/usr/bin/env python3

N = int(input())
S = input()

ans = S.count('R') * S.count('G') * S.count('B')

for i in range(len(S)):
    for d in range(len(S)):
        j = i + d
        k = j + d
        if k >= N:
            break

        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

N = input()
S = input()
sli = [c for c in S]

nR = sli.count('R')
nG = sli.count('G')
nB = sli.count('B')

dx = 1
ng = 0
for i, c in enumerate(sli):
    rl = []
    dx = 1
    while 1:
        if dx * 2 + i > len(sli) - 1:
            break
        rl.append([i, i + dx, i + dx*2])
        dx += 1

    for ind in rl:
        if len(set([sli[ind[0]], sli[ind[1]], sli[ind[2]]])) == 3:
            ng += 1


n = nR * nG * nB - ng
print(str(n))


Fixed submission:
#!/usr/bin/env python3

N = int(input())
S = input()

ans = S.count('R') * S.count('G') * S.count('B')

for i in range(len(S)):
    for d in range(len(S)):
        j = i + d
        k = j + d
        if k >= N:
            break

        if S[i] != S[j] and S[j] != S[k] and S[k] != S[i]:
            ans -= 1

print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

# line1 = '12 3'
# line2 = '4 56 78 901 2 345 67 890 123 45 6 789'
# N, M = [int(x) for x in line1.split()]
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
if A[M] < total * (1 / (4 * M)):
    print('No')
else:
    print('Yes')


Fixed submission:
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
thre = total * (1 / (4*M))
if A[M-1] < thre:
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

# line1 = '12 3'
# line2 = '4 56 78 901 2 345 67 890 123 45 6 789'
# N, M = [int(x) for x in line1.split()]
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
if A[M] < total * (1 / (4 * M)):
    print('No')
else:
    print('Yes')


Fixed submission:
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
thre = total * (1 / (4*M))
if A[M-1] < thre:
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3


N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

A = sorted(A)[::-1]
total = sum(A)
print(A[M-1])
if A[M] < total * (1 / (4 * M)):
    print('No')
else:
    print('Yes')


Fixed submission:
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
thre = total * (1 / (4*M))
if A[M-1] < thre:
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3


N, M = list(map(int, input().split()))
A = list(map(int, input().split()))

A = sorted(A)[::-1]
total = sum(A)
print(A[M-1])
if A[M] < total * (1 / (4 * M)):
    print('No')
else:
    print('Yes')


Fixed submission:
# A = [int(x) for x in line2.split()]

N, M = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]


A = sorted(A)[::-1]
total = sum(A)
thre = total * (1 / (4*M))
if A[M-1] < thre:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

import numpy as np

# line1 = "2 3"
# line2 = ['1 32', '2  63', '1 12']

N, M = map(int,  input().split())
prefinfo = [input() for i in range(N)]
PY = [list(map(int, line.split())) for line in prefinfo]

PY = np.array(PY)
cn = np.array([np.arange(np.shape(PY)[0])])
cc = np.array([np.zeros(np.shape(PY)[0], dtype=int)])

city_list = np.hstack([cn.T, PY, cc.T])
cl_ysort = city_list[np.argsort(city_list[:, 2])]
city_count = np.zeros(N+1, dtype=int)
for i, cinfo in enumerate(cl_ysort):
    pref = cinfo[1]
    city_count[pref] += 1
    cl_ysort[i, 3] = city_count[pref]

cl_idsort = cl_ysort[np.argsort(cl_ysort[:, 0])]

[print('{:06d}{:06d}'.format(cl[1], cl[3])) for cl in cl_idsort]


Fixed submission:
#!/usr/bin/env python3

import numpy as np

# line1 = "2 3"
# line2 = ['1 32', '2  63', '1 12']

N, M = map(int,  input().split())
prefinfo = [input() for i in range(M)]
PY = [list(map(int, line.split())) for line in prefinfo]

PY = np.array(PY)
cn = np.array([np.arange(np.shape(PY)[0])])
cc = np.array([np.zeros(np.shape(PY)[0], dtype=int)])

city_list = np.hstack([cn.T, PY, cc.T])
cl_ysort = city_list[np.argsort(city_list[:, 2])]
city_count = np.zeros(N+1, dtype=int)
for i, cinfo in enumerate(cl_ysort):
    pref = cinfo[1]
    city_count[pref] += 1
    cl_ysort[i, 3] = city_count[pref]

cl_idsort = cl_ysort[np.argsort(cl_ysort[:, 0])]

[print('{:06d}{:06d}'.format(cl[1], cl[3])) for cl in cl_idsort]
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ps = list(map(int, input().split()))

result = 1
for i in range(1,n):
  if ps[i] < min(ps[:i]):
    result += 1
print(result)

Fixed submission:
n = int(input())
ps = list(map(int, input().split()))

result = 0
min_p = ps[0]
for i in range(0,n):
  if ps[i] <= min_p:
    result += 1
    min_p = ps[i]
print(result)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
As = list(map(int, input().split()))

prime = [2]
for i in range(3, 999, 2):
  for j in range(len(prime)):
    if i % prime[j] == 0:
      break
    elif prime[j] > pow(i, 1/2):
      prime.append(i)
      break
    
mat = np.zeros((n, len(prime)))

for i in range(len(As)):
  a = As[i]
  for j in range(len(prime)):
    while True:
      if a % prime[j] == 0:
        mat[i,j] += 1
        a /= prime[j]
      else:
        break
    if a == 1:
      break

max_exp = mat.max(axis=0)

B_total = 0
for i in range(len(As)):
  _exp = max_exp - mat[i]
  b = 1
  for j in range(len(prime)):
    b *= prime[j]**_exp[j]
  B_total += b
  B_total = B_total % (pow(10,9)+7)

print(int(B_total % (pow(10,9)+7)))

Fixed submission:
from fractions import gcd

def lcm(c,d):
    return c//gcd(c,d)*d
mod=10**9+7

n=int(input())
a=[int(i) for i in input().split()]
l=a[0]
for i in range(1,n):
    l=lcm(l,a[i])
ans=0
for i in range(n):
    ans+=l//a[i]
    #ans%=mod
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
As = list(map(int, input().split()))

prime = [2]
for i in range(3, 999, 2):
  for j in range(len(prime)):
    if i % prime[j] == 0:
      break
    elif prime[j] > pow(i, 1/2):
      prime.append(i)
      break
    
mat = np.zeros((n, len(prime)))

for i in range(len(As)):
  a = As[i]
  for j in range(len(prime)):
    while True:
      if a % prime[j] == 0:
        mat[i,j] += 1
        a /= prime[j]
      else:
        break
    if a == 1:
      break

max_exp = mat.max(axis=0)

B_total = 0
for i in range(len(As)):
  _exp = max_exp - mat[i]
  b = 1
  for j in range(len(prime)):
    b *= prime[j]**_exp[j]
  B_total += b

print(int(B_total % (pow(10,9)+7)))

Fixed submission:
from fractions import gcd

def lcm(c,d):
    return c//gcd(c,d)*d
mod=10**9+7

n=int(input())
a=[int(i) for i in input().split()]
l=a[0]
for i in range(1,n):
    l=lcm(l,a[i])
ans=0
for i in range(n):
    ans+=l//a[i]
    #ans%=mod
print(ans%mod)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = int(input())
As = list(map(int, input().split()))

prime = [2]
for i in range(3, 999, 2):
  for j in range(len(prime)):
    if i % prime[j] == 0:
      break
    elif prime[j] > pow(i, 1/2):
      prime.append(i)
      break
    
mat = np.zeros((n, len(prime)))

for i in range(len(As)):
  a = As[i]
  for j in range(len(prime)):
    while True:
      if a % prime[j] == 0:
        mat[i,j] += 1
        a /= prime[j]
      else:
        break
    if a == 1:
      break

LCM = 1
max_exp = mat.max(axis=0)
for j in range(len(prime)):
  LCM *= prime[j]**max_exp[j]

B_total = 0
for i in range(len(As)):
  B_total += LCM / As[i]

print(int(B_total % (pow(10,9)+7)))

Fixed submission:
from fractions import gcd

def lcm(c,d):
    return c//gcd(c,d)*d
mod=10**9+7

n=int(input())
a=[int(i) for i in input().split()]
l=a[0]
for i in range(1,n):
    l=lcm(l,a[i])
ans=0
for i in range(n):
    ans+=l//a[i]
    #ans%=mod
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
n = int(input())

hlist = input().split()

cnt = 0

for i in range(n):
        if hlist[i] == "Y":
                cnt += 1
if cnt > 0:
        print ('Four')
else:
        print ('Three')
~             

Fixed submission:
n = int(input())

hlist = input().split()

cnt = 0

for i in range(n):
        if hlist[i] == "Y":
                cnt += 1
if cnt > 0:
        print ('Four')
else:
        print ('Three')
Buggy python submission (verdict: Runtime Error):
date = input().split("/")
    sum = int(date[0]) * 365 + int(date[1]) * 30 + int(date[2])

    if 737085 < sum:
        print("TBD")
    else:
        print("Heisei")

Fixed submission:
date = input().split("/")
sum = int(date[0]) * 365 + int(date[1]) * 30 + int(date[2])

if 737085 < sum:
    print("TBD")
else:
    print("Heisei")
Buggy python submission (verdict: Runtime Error):
x = input()
big = x // 500
small = x % 500 // 5
grace = big + small
print(grace)

Fixed submission:
x = int(input())
big = x // 500
small = x % 500 // 5
grace = big*1000 + small*5
print(grace)
Buggy python submission (verdict: Runtime Error):
k, n = input().split()
a = list(map(int, input().split()))
a.sorted()
max_diff = 0
for idx in range(len(a)-1):
  diff = a[idx+1] - a[idx]
  if max_diff < diff:
    max_diff = diff

ans = k - max_diff
print(ans)

Fixed submission:
k, n = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
max_diff = k - a[n-1] + a[0]
for idx in range(len(a)-1):
  diff = a[idx+1] - a[idx]
  if max_diff < diff:
    max_diff = diff
max_diff = max_diff
ans = k - max_diff
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
a = a -1
e = (c * d) // math.gcd(c, d)
nc = b // c - a // c
nd = b // d - a // d
ne = b // e - a // e

print(b - a - (nc + nd - ne))




Fixed submission:
import fractions
a, b, c, d = map(int, input().split())
a = a -1
e = (c * d) // fractions.gcd(c, d)
nc = b // c - a // c
nd = b // d - a // d
ne = b // e - a // e

print(b - a - (nc + nd - ne))

Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
a = a -1
e = (c * d) // math.gcd(c, d)
nc = b // c - a // c
nd = b // d - a // d
ne = b // e - a // e

print(b - a - (nc + nd - ne))



Fixed submission:
import fractions
a, b, c, d = map(int, input().split())
a = a -1
e = (c * d) // fractions.gcd(c, d)
nc = b // c - a // c
nd = b // d - a // d
ne = b // e - a // e

print(b - a - (nc + nd - ne))
Buggy python submission (verdict: Runtime Error):
p, q, r = list(map(int, input().split()))
pqr.sort()
print(pqr[0] + pqr[1])

Fixed submission:
pqr = list(map(int, input().split()))
pqr.sort()
print(pqr[0] + pqr[1])

Buggy python submission (verdict: Runtime Error):
p, q, r = list(map(int, input().split()))
pqr.sort()
print(pqr[0] + pqr[1])

Fixed submission:
pqr = list(map(int, input().split()))
pqr.sort()
print(pqr[0] + pqr[1])
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
gates = []
for i in range(m):
    gates.append(list(map(int, input().split())))
candidate = [1, n]
for gate in gates:
    if candidate[0] < gate[0]:
        candidate[0] = gate[0]
    if gate[1] < candidate[1]:
        candidate[1] = gate[1]
if candidate[1] == canditate[0]:
    print(0)
else:
    print(candidate[1] - candidate[0] + 1)

Fixed submission:
n, m = map(int, input().split())
gates = []
for i in range(m):
    gates.append(list(map(int, input().split())))
candidate = [1, n]
for gate in gates:
    if candidate[0] < gate[0]:
        candidate[0] = gate[0]
    if gate[1] < candidate[1]:
        candidate[1] = gate[1]
if (candidate[1] >= candidate[0]):
    print(candidate[1] - candidate[0] + 1)
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
gates = []
count = 0
for gate in range(m):
    gates.append(list(map(int, input().split())))
for card in range(n):
    card+=1
    token = True
    for gate in range(m):
        if (card < gates[gate][0] or gates[gate][1] < card):
            token = False
            break
    if token:
        count +=1
print(count)

Fixed submission:
n, m = map(int, input().split())
gates = []
for i in range(m):
    gates.append(list(map(int, input().split())))
candidate = [1, n]
for gate in gates:
    if candidate[0] < gate[0]:
        candidate[0] = gate[0]
    if gate[1] < candidate[1]:
        candidate[1] = gate[1]
if (candidate[1] >= candidate[0]):
    print(candidate[1] - candidate[0] + 1)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
tmp = 0
for p in range(2**n):
    profit = 0
    for j in range(n):
        if((p >> j) & 1):
            profit += (value[j] - cost[j])
    if profit > tmp:
        tmp = profit
print(tmp)

Fixed submission:
n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
tmp = 0

for i in range(len(value)):
    profit = value[i] - cost[i]
    if profit > 0:
        tmp += profit

print(tmp)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
while(1):
    tmpN = abs(N-K)
    if tmpN < N:
        N = tmpN
    else:
        break;
print(N)

Fixed submission:
N, K = map(int, input().split())
N = N%K
while(1):
    tmpN = abs(N-K)
    if tmpN < N:
        N = tmpN
    else:
        break;
print(N)
Buggy python submission (verdict: Runtime Error):
S = input()

if(S[2] == S[3] and S[4] == S[5]):
    return 'Yes'
else:
    return 'No'

Fixed submission:
S = input()
 
if(S[2] == S[3] and S[4] == S[5]):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
K, N = input().split()
distance = list(map(int, input().split()))

relative = []
relative[0] = distance[0]
for i in range(1, len(distance)):
    relative[i] = distance[i+1] - distance[i]
relative.append(K -  distance[-1])
print(sum(relative) - max(relative))

Fixed submission:
K, N = input().split()
distance = list(map(int, input().split()))

relative = []
relative.append(distance[0])
for i in range(int(N)-1):
    relative.append(distance[i+1] - distance[i])
relative[0] += (int(K) -  distance[-1])
print(sum(relative) - max(relative))
Buggy python submission (verdict: Runtime Error):
S = list(input())

if S[2] == S[3] and S[4]==S[5]
    print('Yes')
else:
    print('No')

Fixed submission:
S = list(input())

if S[2] == S[3] and S[4]==S[5]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
num_list = list(map(int, input().split()))

import collections
answer_list = []

for i in range(N):
    new_list = num_list[0:i]+num_list[i+1:N]
    c = collections.Counter(new_list)

    comb = 0

    for value in c.values():
        comb += value*(value-1)/2

    answer_list.append(comb)

for i in answer_list:
    print(int(i))

Fixed submission:
N = int(input())
num_list = list(map(int, input().split()))

from collections import defaultdict
d = defaultdict(int)
for i in num_list:
  d[i] += 1
 
total = 0
for i in set(num_list):
  x = d[i]
  total += x*(x-1)/2
 
for i in num_list:
  x = d[i]
  print(int(total-((x*(x-1)/2))+((x-1)*(x-2)/2)))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
# num_list = list(input().split())
num_list = list(map(int, input().split()))

import collections
answer_list = []

for i in range(N):
    poped_num = num_list[i]
    num_list.pop(i)
    c = collections.Counter(num_list)
    num_list.insert(i, poped_num)

    comb = 0
    
    for value in c.values():
        comb += value*(value-1)/2

    answer_list.append(comb)

for i in answer_list:
    print(int(i))

Fixed submission:
N = int(input())
num_list = list(map(int, input().split()))

from collections import defaultdict
d = defaultdict(int)
for i in num_list:
  d[i] += 1
 
total = 0
for i in set(num_list):
  x = d[i]
  total += x*(x-1)/2
 
for i in num_list:
  x = d[i]
  print(int(total-((x*(x-1)/2))+((x-1)*(x-2)/2)))
Buggy python submission (verdict: Runtime Error):
S = [int(e) for e in input().split()]
list_a =  [int(e) for e in input().split()]
list_b =  [int(e) for e in input().split()]

dis_list = []

for i in range(S[2]):
    dis_list.append([int(e) for e in input().split()])

cost_list = []
min_num = min(list_a) + min(list_b)

for i in list_a:
    for j in list_b:
        cost_list.append(i+j)


for l in dis_list:
    if (cost_list[S[0]*(l[0]-1)+l[1]-1] - l[2]) < min_num:
        min_num = cost_list[S[0]*(l[0]-1)+l[1]-1] - l[2]

print(min_num)


Fixed submission:
S = list(input())

word_num = int(len(S)/2)

temp_num = 0

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

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

Buggy python submission (verdict: Runtime Error):
S = [int(e) for e in input().split()]
list_a =  [int(e) for e in input().split()]
list_b =  [int(e) for e in input().split()]

dis_list = []

for i in range(S[2]):
    dis_list.append([int(e) for e in input().split()])

cost_list = []
min_num = min(list_a)+min(list_b)

for i in list_a:
    for j in list_b:
        cost_list.append(i+j)


for l in dis_list:
    if cost_list[S[0]*(l[0]-1)+l[1]-1] - l[2] < min_num:
        min_num = cost_list[S[0]*(l[0]-1)+l[1]-1] - l[2]

print(min_num)


Fixed submission:
S = list(input())

word_num = int(len(S)/2)

temp_num = 0

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

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

Buggy python submission (verdict: Runtime Error):
S = [int(e) for e in input().split()]
list_a =  [int(e) for e in input().split()]
list_b =  [int(e) for e in input().split()]

dis_list = []

for i in range(S[2]):
    dis_list.append([int(e) for e in input().split()])

cost_list = []

for i in list_a:
    for j in list_b:
        cost_list.append(i+j)

Fixed submission:
S = list(input())

word_num = int(len(S)/2)

temp_num = 0

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

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

Buggy python submission (verdict: Runtime Error):
S = [int(e) for e in input().split()]
list_a =  [int(e) for e in input().split()]
list_b =  [int(e) for e in input().split()]

dis_list = []

for i in range(S[2]):
    dis_list.append([int(e) for e in input().split()])

Fixed submission:
S = list(input())

word_num = int(len(S)/2)

temp_num = 0

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

if len(S) % 2 == 0 and temp_num == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
result = 0
for i in range(n):
    for j in range(n):
        for k in range(n):
            result += math.gcd(math.gcd(i + 1, j + 1), k + 1)
print(result)

Fixed submission:
import math
n = int(input())
result = 0
for i in range(n):
    for j in range(n):
        for k in range(n):
            result += math.gcd(math.gcd(i + 1, j + 1), k + 1)
print(result)
Buggy python submission (verdict: Runtime Error):
MAX_N = 1_000_000_000
n, k = map(int, input().split())

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break


Fixed submission:
MAX_N = pow(10, 9)
n, k = map(int, input().split())

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break

Buggy python submission (verdict: Runtime Error):
MAX_N = 1_000_000_000
n, k = map(int, input().split())

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break
else:
    raise 'iteration over'

Fixed submission:
MAX_N = pow(10, 9)
n, k = map(int, input().split())

for i in range(MAX_N):
    if n < pow(k, i):
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
s = input()
week = ['SUN', 'MON', 'THE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - week.index(s))

Fixed submission:
s = input()
week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(7 - week.index(s))