Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().strip())

r = S.count('R')
w = S.count('W')

ans = min(r, w)

ri = S.index('R')
r2 = S[:ri].count('R')
w2 = S[ri:].count('W')

ans = min(ans, r2+w2)
print(ans)



Fixed submission:
N = int(input())
S = list(input().strip())

l = 0
r = N-1
ans = 0
while l < r:
    if S[l] == 'W' and S[r] == 'R':
        ans += 1
        l += 1
        r -= 1
    while l < N and S[l] != 'W':
        l += 1
    while r >= 0 and S[r] != 'R':
        r -= 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().strip())

r = S.count('R')
w = S.count('W')

ans = min(r, w)

ri = S.index('R')
r2 = S[:ri+1].count('W')

ans = min(ans, r2)
print(ans)



Fixed submission:
N = int(input())
S = list(input().strip())

l = 0
r = N-1
ans = 0
while l < r:
    if S[l] == 'W' and S[r] == 'R':
        ans += 1
        l += 1
        r -= 1
    while l < N and S[l] != 'W':
        l += 1
    while r >= 0 and S[r] != 'R':
        r -= 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(input().strip())

r = S.count('R')
w = S.count('W')

ans = min(r, w)

ri = S.index('R')
r2 = S[ri:].count('W')

ans = min(ans, r2)
print(ans)



Fixed submission:
N = int(input())
S = list(input().strip())

l = 0
r = N-1
ans = 0
while l < r:
    if S[l] == 'W' and S[r] == 'R':
        ans += 1
        l += 1
        r -= 1
    while l < N and S[l] != 'W':
        l += 1
    while r >= 0 and S[r] != 'R':
        r -= 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def divs(M):
    divs = set()
    for i in range(1, int(M ** 0.5) + 1):
        if M % i == 0:
            divs.add(i)
            divs.add(M // i)
    return len(divs)

N = int(input())

ans = 0
for i in range(N):
    i += 1
    ans += i * divs(i)

print(ans)

Fixed submission:
N = int(input())

table = [0] * (N + 1)

for i in range(1, N + 1):
    for j in range(i, N + 1, i):
        table[j] += 1

ans = 0
for i in range(N):
    i += 1
    ans += i * table[i]

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
count=0
s=a+b
t=a+b+c
if k<=a:
    for i in k:
        count+=1
elif a<k and k<=s:
    count=1*a
elif k<t:
    p=(-1)*c
    count=1*a+p
print(count)


Fixed submission:
a,b,c,k=map(int,input().split())
count=0
if k<=a:
    count=1*k
elif a<k and k<=(a+b):
    count=1*a
elif (a+b)<k and k<=(a+b+c):
    count=1*a+(-1)*(k-a-b)
print(count)
Buggy python submission (verdict: Runtime Error):
N=int(input())
arr=[0]*N
for i in range(1,N):
    A=int(input())
    arr[A-1]+=1
for i in range(0,N):
    print(arr[i])

Fixed submission:
N=int(input())
L=[0]*N
A=list(map(int,input().split()))
for i in range(0,len(A)):
    L[A[i]-1]+=1
for i in range(0,N):
    print(L[i])
Buggy python submission (verdict: Runtime Error):
try:
  s = input()
  t = input()
  count = 0
  for i in range(len(s)):
  if not s[i] == t[i]:
    count += 1
  print(count)
except EOFError:
  print('EOFError')
  

Fixed submission:
m=input()
n=input()
count=0
for i in range(len(m)):
   if m[i]!=n[i]:
      count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
count = 0
for i in range(len(a)):
  if not s[i] == t[i]:
    count += 1
print(count)

Fixed submission:
m=input()
n=input()
count=0
for i in range(len(m)):
   if m[i]!=n[i]:
      count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
n = N % 1000
if n == 0;
  	print(0)
else;
  	print(1000-n)

Fixed submission:
N = int(input())
n = N%1000
if n==0:
  	print(0)
else:
  	print(1000-n)

Buggy python submission (verdict: Runtime Error):
N = int(input())
n = N%1000
if n=0;
  	print(0)
else;
  	print(1000-n)

Fixed submission:
N = int(input())
n = N%1000
if n==0:
  	print(0)
else:
  	print(1000-n)

Buggy python submission (verdict: Runtime Error):
N = int(input())
n = N%1000
if n=0:
  	print(0)
else:
  	print(1000-n)
 


Fixed submission:
N = int(input())
n = N%1000
if n==0:
  	print(0)
else:
  	print(1000-n)
Buggy python submission (verdict: Runtime Error):
x = input()

ans = x.islower()

#大文字 false
if ans == false:
  print('A')
else:
  print('a')

Fixed submission:
x = input()

ans = x.islower()

#大文字 false
if ans == False:
  print('A')
else:
  print('a')
Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())

aaa = list(map(int, input().split()))



ans = 1

for i in range(N):
    ans = ans * aaa[i]

if ans > 10 ** 18:
        ans = -1
print(ans)






Fixed submission:

N = int(input())

aaa = list(map(int, input().split()))
ans = 1

if 0 in aaa:
    ans = 0
else:
    for i in range(N):
        if ans > 10 ** 18:
            ans = -1
            break
        else:
            ans = ans * aaa[i]


if ans > 10 ** 18:
    ans = -1


print(ans)

Buggy python submission (verdict: Runtime Error):

N = int(input())

aaa = list(map(int, input().split()))



ans = 1

for i in range(N):
    if ans > 10 ** 18:
    ans = -1
    break
    else:
        ans = ans * aaa[i]

print(ans)






Fixed submission:

N = int(input())

aaa = list(map(int, input().split()))
ans = 1

if 0 in aaa:
    ans = 0
else:
    for i in range(N):
        if ans > 10 ** 18:
            ans = -1
            break
        else:
            ans = ans * aaa[i]


if ans > 10 ** 18:
    ans = -1


print(ans)

Buggy python submission (verdict: Runtime Error):

N = int(input())

aaa = list(map(int, input().split()))



ans = 1

for i in range(N):
    if ans > 10 ** 18:
    print(-1)
    else:
        ans = ans * aaa[i]
print(ans)








Fixed submission:

N = int(input())

aaa = list(map(int, input().split()))
ans = 1

if 0 in aaa:
    ans = 0
else:
    for i in range(N):
        if ans > 10 ** 18:
            ans = -1
            break
        else:
            ans = ans * aaa[i]


if ans > 10 ** 18:
    ans = -1


print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input)
if a == 'ABC':
  print('ARC')
elif a == 'ARC':
  print('ABC')

Fixed submission:

#提出時にコメントアウトを外す。
a = input()
if a == 'ABC':
  print('ARC')
elif a == 'ARC':
  print('ABC')
Buggy python submission (verdict: Runtime Error):
X = int(input())
if X>=30:
    print(Yes)
else:
    print(No)

Fixed submission:
x=int(input())
if x>=30:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
X = int(input())
if X<=30:
    print(Yes)
else:
    print(No)

Fixed submission:
x=int(input())
if x>=30:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = map(int,input().split())
for i in range(0,4):
    if a[i]==0:
        print(i+1)

Fixed submission:
a = list(map(int,input().split()))
for i in range(0,5):
    if a[i]==0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
for i in range (0,x+1):
    if y==2*i+4*(x-i):
        print(Yes)
    else:
        if i==x:
            print(No)

Fixed submission:
x,y = map(int,input().split())
ans='No'
for i in range(x+1):
    if y == 2*i+4*(x-i):
        ans='Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
print(int(input())*math.pi*2)

Fixed submission:
print(int(input())*6.28)

Buggy python submission (verdict: Runtime Error):
R=int(input())
  print(2*math.pi*R)

Fixed submission:
print(int(input())*6.28)
Buggy python submission (verdict: Runtime Error):
a,b,c=input()
if a=='7' or b=='7' or c=='7':
    print(Yes)
else:
    print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c=input()
if a=='7' or b=='7' or c=='7':
  print(Yes)
else:
  print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
a,b,c=input()
if a=='7' or b=='7' or c=='7';
  print(Yes)
else;
  print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N=input()
if N[0]==7 or N[1]==7 or N[2]==7:
  print(Yes)
else:
  print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N=input().split()
if N[0]==7 or N[1]==7 or N[2]==7;
  print(Yes)
else;
  print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N=input().split()
if N[0]==7 or N[1]==7 or N[2]==7:
    print(Yes)
else:
    print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N=input().split()
if N[0]==7 or N[1]==7 or N[2]==7:
  print(Yes)
else:
  print(No)

Fixed submission:
N=input()
if N[0]=='7' or N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N, K, *p = map(int, open(0).read().split())

import itertools
lis = list(itertools.combinations(range(N), K))

mi = 0
for x in lis:
    cur = 0
    for pos in x:
        cur += p[pos]

    if mi == 0:
        mi = cur
    else:
        mi = min(mi, cur)

print(mi)

Fixed submission:
N, K, *p = map(int, open(0).read().split())

sortp = sorted(p)

ans = 0
for x in range(K):
    ans += sortp[x]
print(ans)
Buggy python submission (verdict: Runtime Error):
def solve(X, Y):
    import sympy as sp
    sp.init_printing()
    sp.var('a, b')
    eq1 = sp.Eq(2 * a + 4 * b, Y)
    eq2 = sp.Eq(a + b, X)
    res = sp.solve([eq1, eq2], [a, b])
    x = res[a]
    y = res[b]
    if x == int(x) and y == int(y) and x >= 0 and y >= 0:
        print('Yes')
    else:
        print('No')

X, Y = map(int, open(0).read().split())
solve(X, Y)

Fixed submission:
def solve(X, Y):
    from numpy.linalg import solve
    left = [[1, 1], [2, 4]]
    right = [X, Y]
    res = solve(left, right)
    x = res[0]
    y = res[1]

    if x == float(int(x)) and y == float(int(y)) and x >= 0 and y >= 0:
        print('Yes')
    else:
        print('No')
 
X, Y = map(int, open(0).read().split())
solve(X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
N, *a = map(int, open(0).read().split())

ans = 1
for x in a:
    ans = ans * x
    if ans == 0:
      print(0)
      exit()

if 10 ** 18 < ans:
    print(-1)
else:
    print(ans)


Fixed submission:
N, *a = map(int, open(0).read().split())

if 0 in a:
    print(0)
    exit()

ans = 1
for x in a:
    ans = ans * x
    if 10 ** 18 < ans:
        print(-1)
        exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, *a = map(int, open(0).read().split())

ans = 1
for x in range(n):
    ans *= a[x]

if 10 ** 18 < ans:
    print(-1)
else:
    print(ans)


Fixed submission:
N, *a = map(int, open(0).read().split())

if 0 in a:
    print(0)
    exit()

ans = 1
for x in a:
    ans = ans * x
    if 10 ** 18 < ans:
        print(-1)
        exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, *a = map(int, open(0).read().split())

ans = 1
for x in a:
    ans = ans * x

if 10 ** 18 < ans:
    print(-1)
else:
    print(ans)


Fixed submission:
N, *a = map(int, open(0).read().split())

if 0 in a:
    print(0)
    exit()

ans = 1
for x in a:
    ans = ans * x
    if 10 ** 18 < ans:
        print(-1)
        exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, *a = map(int, open(0).read().split())

ans = 1
for x in range(N):
    ans = ans * a[x]

if 10 ** 18 < ans:
    print(-1)
else:
    print(ans)


Fixed submission:
N, *a = map(int, open(0).read().split())

if 0 in a:
    print(0)
    exit()

ans = 1
for x in a:
    ans = ans * x
    if 10 ** 18 < ans:
        print(-1)
        exit()

print(ans)
Buggy python submission (verdict: Runtime Error):
def solve(N):
    last = int(str(N)[len(N)-1])
    if last == 0 or last == 1 or last == 6 or last == 8:
        print("pon")
    elif last == 3:
        print("bon")
    else:
        print("hon")

N = open(0).read()
solve(N)

Fixed submission:
def solve(N):
    last = int(str(N)[len(N)-1])
    if last == 0 or last == 1 or last == 6 or last == 8:
        print("pon")
    elif last == 3:
        print("bon")
    else:
        print("hon")

N = input()
solve(N)
Buggy python submission (verdict: Time Limit Exceeded):
n, *aa = map(int, open(0).read().split())

for i in range(1, n+1):
    have = aa.count(i)    
    print(have)


Fixed submission:
n, *aa = map(int, open(0).read().split())

from collections import Counter
ca = Counter(aa)

for i in range(1, n+1):
    have = ca[i]
    print(have)

Buggy python submission (verdict: Time Limit Exceeded):
n, *aa = map(int, open(0).read().split())

for i in range(1, n+1):
    have = 0
    for a in aa:
        if a == i:
            have += 1
    
    print(have)


Fixed submission:
n, *aa = map(int, open(0).read().split())

from collections import Counter
ca = Counter(aa)

for i in range(1, n+1):
    have = ca[i]
    print(have)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def calc(a, b, c):
    return reduce(math.gcd, set([a, b, c]))

def solve(k):
    import itertools
    pattern = itertools.product(range(1, k+1), repeat=3)

    count = 0
    for x in pattern:
        gcd = calc(x[0], x[1], x[2])
        count += gcd

    return count


k = int(input())

print(solve(k))


Fixed submission:
from math import gcd

k = int(input())

ir = range(1, k+1)
jr = range(1, k+1)
lr = range(1, k+1)

count = 0
for i in ir:
  for j in jr:
    for l in lr:
      count += gcd(i, gcd(j, l))

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def calc(a, b, c):
    return reduce(math.gcd, [a, b, c])

def solve(k):
    count = 0
    for i in range(1, k+1):
        for j in range(1, k+1):
            for k in range(1, k+1):
                count += calc(i, j, k)

    return count

k = int(input())

print(solve(k))


Fixed submission:
from math import gcd

k = int(input())

ir = range(1, k+1)
jr = range(1, k+1)
lr = range(1, k+1)

count = 0
for i in ir:
  for j in jr:
    for l in lr:
      count += gcd(i, gcd(j, l))

print(count)
Buggy python submission (verdict: Runtime Error):
k = int(input())
 
lunlun = []
 
end = False
while True:
    val = 0
    while True:
        val += 1
        val_list = [int(x) for x in list(str(val))]
        is_lun = True 
        for x in range(len(val_list) - 1):
            if abs(val_list[x] - val_list[x + 1]) <= 1:
                continue
            else:
                is_lun = False
        if is_lun:
            lunlun.append(val)
        else:
            continue
        if len(lunlun) == k:
            end = True
            break
    if end:
        break
 
print(lunlun[k - 1])

Fixed submission:
a, b, c = map(int, open(0).read().split())
print("{} {} {}".format(c, a, b))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

input1 = [int(x) for x in input().split()]
lake = input1[0]
homes = input1[1]
input2 = [int(x) for x in input().split()]

result = 1000000
last = homes - 1
for x in range(homes):
    forward = 0
    backward = 0
    start = input2[x]

    # forward
    if x == 0:
        forward = input2[last] - start
    else:
        forward = (lake - start) + input2[x - 1]
    
    # backward
    if x == last:
        backward = (start) - input2[0]
    else:
        backward = (start) + lake - (input2[x + 1])

    #print("forward: {}, backward: {}".format(forward, backward))
    result = min(result, forward, backward)

print(result)


Fixed submission:
string = input()

if string[2] == string[3] and string[4] == string[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())

ans = np.zeros(int(N))

if N<10001 and N>3:
    maxa = int(np.sqrt(N-2))
    for x in range(1,maxa):
        for y in range(1,x):
            for z in range(1,y):
                p = x*x+y*y+z*z+x*y+y*z+z*x
                if p<N+1:
                    ans[p-1] += 6


    for x in range(1,maxa):
        for y in range(1,x):
            p = x*x*3+y*y+x*y*2
            if p<N+1:
                ans[p-1] += 3
            p = y*y*3+x*x+x*y*2
            if p<N+1:
                ans[p-1] += 3

    for x in range(1,maxa):
        p = x*x*6
        if p<N+1:
            ans[p-1] += 1

for x in range(0,N):
    print(int(ans[x]))

Fixed submission:
import numpy as np
a, b, c = map(int,input().split())
count = 0

for i in range(a,b+1):
    if i % c == 0:
        count += 1

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

pi = np.pi

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

S = x/a

if S >= a*b/2:
    h = x/(a**2)
    ans = np.arctan(a / 2 / (b - h)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)

Fixed submission:
import numpy as np

pi = np.pi

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

S = x/a

if S >= a*b/2:
    h = x/(a**2)
    ans = np.arctan((b - h)/(a/2)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)

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

pi = np.pi

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

S = x/a

if S >= a*b/2:
    ans = np.arctan(a / 2 / (b - h)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)

Fixed submission:
import numpy as np

pi = np.pi

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

S = x/a

if S >= a*b/2:
    h = x/(a**2)
    ans = np.arctan((b - h)/(a/2)) / (2 * pi) * 360
elif S <= a*b/2:
    ans = np.arctan(b/(2*S/b)) / (2 * pi) * 360

print(ans)
Buggy python submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))


if N == 0:
    print(N)

initialK = K

if N <= initialK/2:
    print(N)
while True:
    K = N%K
    if K <= initialK/2:
        print(K)
        break

Fixed submission:
X,Y,Z = list(map(int, input().split()))

print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
N,K = list(map(int, input().split()))


if N == 0:
    print(N)

initialK = K
while True:
    if N <= initialK/2:
        print(N)
        break
    K = N%K
    if K <= initialK/2:
        print(K)
        break


Fixed submission:
X,Y,Z = list(map(int, input().split()))

print(Z, X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
i = int(input())

while True:
    i = i-1000
    if 0 < i < 1000:
        print(1000 - i)
        break
    elif i == 0:
        print(0)
        break

Fixed submission:
import math
i = int(input())

s, f = math.modf(i/1000)
if s != 0.0:
    f += 1
v = int((f) * 1000) - i
if v >= 1000:
    print(2000 - v)
else:
    print(v)

Buggy python submission (verdict: Time Limit Exceeded):
i = int(input())

while True:
    i = i-1000
    if len(str(i)) == 3:
        print(1000 -  i )
        break
    elif i == 0:
        print(0)
        break

Fixed submission:
import math
i = int(input())

s, f = math.modf(i/1000)
if s != 0.0:
    f += 1
v = int((f) * 1000) - i
if v >= 1000:
    print(2000 - v)
else:
    print(v)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
res=0
for x in p[:K]:
	res+=x

print(res)

Fixed submission:
S=input()
T=input()

res=0
for i in range(len(S)):
	if not S[i]==T[i]:
		res+=1
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

A=list(map(int,input().split(' ')))

res=1
for x in A:
	res*=x

if res>pow(10,18):
	print('-1')
else:
	print(res)

Fixed submission:
N=int(input())

A=list(map(int,input().split(' ')))

if 0 in A:
	print('0')
	exit()

res=1
for x in A:
	res*=x
	if res>pow(10,18):
		print('-1')
		exit()

else:
	print(res)
Buggy python submission (verdict: Runtime Error):
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if i==0:
			if T[i+1]=='P':
				res+='D'
			else:
				res+='P'
		else:
			if i+1<len(T):
				if res[i-1]=='P' or T[i+1]=='P':
					res+='D'
				else:
					res+='P'
			else:
				res+='D'
	else:
		res+=T[i]
print(res)


Fixed submission:
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if i==0:
			if len(T)==1:
				res+='D'
			else:
				if T[i+1]=='P':
					res+='D'
				else:
					res+='P'
		else:
			if i+1<len(T):
				if res[i-1]=='P' or T[i+1]=='P':
					res+='D'
				else:
					res+='P'
			else:
				res+='D'
	else:
		res+=T[i]
print(res)

Buggy python submission (verdict: Runtime Error):
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if  not i-1<0:
			if res[i-1]=='P':
				res+='D'
			else:
				if not i+1>=len(T):
					if T[i+1]=='P':
						res+='D'
					else:
						res+='P'
				else:
					res+='D'
		else:
			if T[i+1]=='D':
				res+='P'
			else:
				res+='D'
	else:
		res+=T[i]

print(res)


Fixed submission:
T=input()
res=''
for i in range(len(T)):
	if T[i]=='?':
		if i==0:
			if len(T)==1:
				res+='D'
			else:
				if T[i+1]=='P':
					res+='D'
				else:
					res+='P'
		else:
			if i+1<len(T):
				if res[i-1]=='P' or T[i+1]=='P':
					res+='D'
				else:
					res+='P'
			else:
				res+='D'
	else:
		res+=T[i]
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
hn = list(map(int, input().split()))

max_move = 0

for i in reversed(range(1, N)):
    move = 0
    for j in reversed(range(1, i+1)):
        if hn[j-1] >= hn[j]:
            move += 1
        else:
            break
    if move >= max_move:
        max_move = move
print(max_move)


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
hn = list(map(int, input().split()))

max_move = 0
move = 0

for i in reversed(range(1, N)):
    if hn[i-1] >= hn[i]:
        move += 1
    else:
        if move >= max_move:
            max_move = move
        move = 0
if move >= max_move:
    max_move = move
print(max_move)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

M, D = map(int, input().split())

count=0
for i in range(4, M+1):
    for j in range(22, D+1):
        str_j = str(j)
        if str_j[0] <= 1:
            continue
        if (int(str_j[0]) * int(str_j[1])) == i:
            count += 1
print(count)


Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

M, D = map(int, input().split())

count=0
for i in range(4, M+1):
    for j in range(22, D+1):
        str_j = str(j)
        if int(str_j[1]) <= 1:
            continue
        if (int(str_j[0]) * int(str_j[1])) == i:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

res = 1
for i in a:
    res *= i

if res > 10**18:
    print(-1)
else:
    print(res)

Fixed submission:
a, b = map(int, input().split())

print(a*b)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

nc=0
mc=0
if n >=2:
    nc=math.factorial(n) // (math.factorial(n - 2) * math.factorial(2))
if m>=2:
    mc=math.factorial(m) // (math.factorial(m - 2) * math.factorial(2))

print(nc+mc)


Fixed submission:
import math

def resolve():

    n, m = map(int, input().split())

    nc=0
    mc=0
    if n >=2:
        nc=math.factorial(n) // (math.factorial(n - 2) * math.factorial(2))
    if m>=2:
        mc=math.factorial(m) // (math.factorial(m - 2) * math.factorial(2))

    print(nc+mc)

resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    a, b,c = map(int, input().split())
    if math.sqrt(a) + math.sqrt(b) < math.sqrt(c):
        print("Yes")
    else:
        print("No")

resolve()

Fixed submission:
from decimal import *
def resolve():
    a, b, c = map(int, input().split())
    if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
        print("Yes")
    else:
        print("No")

resolve()