Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03597 (python)

Fixed submission:
n = int(input())
a = int(input())
print(n*n-a)

Buggy submission (verdict: Runtime Error):
A, B, C, D, E, F = map(int, input().split())
# A *= 100
# B *= 100

max_solvent = 0
max_solute = 0
max_strength = 0.0

for na in range(0, 31):
    for nb in range(0, 31):
        for nc in range(0, 101):
            for nd in range(0, 101):

                solute = nc * C + nd * D
                solvent = 100 * na * A + 100 * nb * B

                # if not (any([na, nb]) and any([nc, nd])):
                    # continue
                if solvent == 0:
                    break

                if solute + solvent > F:
                    # print("exceeded")
                    break

                else:
                    # if (solvent/100) * E < solute:
                    if solvent/100 * E >= solute:
                    # print("exceeded2")
                    # break
                        strength = 100 * solute / (solute + solvent)
                        # print(strength, solvent+solute, solute)
                        if max_strength <= strength:
                            max_strength = strength
                            max_solute = solute
                            max_solvent = solute + solvent

print(max_solvent, max_solute)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a == b:
    print(c)
elif a == c:
    print(b)
else:
    print(a)
Problem p03623 (python)

Fixed submission:
x, a, b = list(map(int, input().split()))
print("A" if abs(x-a) < abs(x-b) else "B")

Buggy submission (verdict: Runtime Error):
x, a, b = list(map(int, input().split())
print("a" if abs(x-a) < abs(x-b) else "b")
Problem p03651 (python)

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

P = "POSSIBLE"
IP = "IMPOSSIBLE"

M = max(A)

def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)

t = gcd(A[0], A[0])
if N > 1:
    for a in A[1:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)

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

P = "POSSIBLE"
IP = "IMPOSSIBLE"

M = max(A)

def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)

t = gcd(A[1], A[0])
if N >= 2:
    for a in A[2:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)

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

P = "POSSIBLE"
IP = "IMPOSSIBLE"

M = max(A)

def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)

t = gcd(A[1], A[0])
if N >= 2:
    for a in A[2:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)

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

P = "POSSIBLE"
IP = "IMPOSSIBLE"

M = max(A)

def gcd(a, b):
    if a == 0:
        return b
    else:
        return gcd(b%a, a)

t = gcd(A[1], A[0])
if N >= 2:
    for a in A[2:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)

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

P = "POSSIBLE"
IP = "IMPOSSIBLE"

A.sort()

def gcd(a, b):
    if a == 0:
        return b
    else:
        gcd(b, b%a)

t = gcd(A[1], A[0])
if N <= 2:
    for a in A[2:]:
        t = gcd(t, a)

if K%t == 0 and K <= M:
    print(P)
else:
    print(IP)
Problem p03696 (python)

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

needs_right = 0
needs_left = 0

for c in S:
    if c == '(':
        needs_right += 1
    else:
        if needs_right == 0:
            needs_left += 1
        else:
            needs_right -= 1

print('(' * needs_left + S + ')' * needs_right)

Buggy submission (verdict: Runtime Error):
_ = input()
S = input()

needs_right = 0, needs_left = 0
for c in S:
    if c == '(':
        needs_right += 1
    else:
        if needs_right == 0:
            needs_left += 1
        else:
            needs_right -= 1

print('(' * needs_left + S + ')' * needs_right)
Problem p03697 (python)

Fixed submission:
a,b = map(int, input().split())
if a +b >= 10:
  print( "error")
else:
  print( a+b)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input())
if a +b >= 10:
  print "error"
else:
  print a+b

Buggy submission (verdict: Runtime Error):
a,b = map(int, input())
if a +b >= 10:
  print "error"
else:
  print a+b
Problem p03729 (python)

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

if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a[-1] == b[0] and b[-1] == c[0]:
    print("Yes")
else:
    print("No")
Problem p03773 (python)

Fixed submission:
A,B = map(int, input().split())

ans = None

if A+B > 23:
  ans = A+B-24
else:
  ans = A+B
print(ans)

Buggy submission (verdict: Runtime Error):
A
 
B
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == 'H':
  print(b)
else:
  if b == 'H':
    print('D')
  else:
    print('H')

Buggy submission (verdict: Runtime Error):
a, b = input().split()

if a == 'H'
  if b == 'H':
  	print('H')
  else:
    print('D')

else:
  if b == 'H':
    print('D')
  else:
    print('H')
Problem p03844 (python)

Fixed submission:
a, op, b = input().split()
if op == '+':
	ans = int(a)+int(b)
else:
	ans = int(a)-int(b)
print(ans)

Buggy submission (verdict: Runtime Error):
a, op, b = input().split()
if op = '+':
	ans = int(a)+int(b)
else:
	ans = int(a) - int(b)
print(ans)
Problem p03944 (python)

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

X = [0] * N
Y = [0] * N
A = [0] * N

for _ in range(N):
    X[_], Y[_], A[_] = list(map(int, input().split()))

# print("test")
# print(W,H,N)

#solve
xb = 0
xe = W
yb = 0
ye = H

for _ in range(N):
    if A[_] == 1:
        # Xiより小さいを黒
        xb = max([xb, X[_]])
    elif A[_] == 2:
        # Xiより大きいを黒
        xe = min([xe, X[_]])
    elif A[_] == 3:
        # Yiより小さいを黒
        yb = max([yb, Y[_]])
    else:
        # Yiより大きいを黒
        ye = min([ye, Y[_]])
    
    # check
    if (xe - xb) <= 0 or (ye - yb) <= 0:
        print(0)
        import sys
        sys.exit()

ans = (xe - xb) * (ye - yb)
print(ans)

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

X = [0] * N
Y = [0] * N
A = [0] * N

for _ in range(N):
    X[_], Y[_], A[_] = list(map(int, input().split()))

# print("test")
# print(W,H,N)

#solve
xb = 0
xe = W
yb = 0
ye = H

for _ in range(N):
    if A[_] == 1:
        # Xiより小さいを黒
        xb = max(xb, X[_])
    elif A[_] == 2:
        # Xiより大きいを黒
        xe = min(xe, X[_])
    elif A[_] == 3:
        # Yiより小さいを黒
        yb = max(yb, Y[_])
    else:
        # Yiより大きいを黒
        ye = min(ye, [_])
    
    # check
    if (xe - xb) <= 0 or (ye - yb) <= 0:
        print(0)
        import sys
        sys.exit()

ans = (xe - xb) * (ye - yb)
print(ans)
Problem p02584 (python)

Fixed submission:
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    global x,k,d
    i = min(k,abs(x//d))
    if abs(x-d*i)<abs(x+d*i):
        x -= d*i
    else:
        x += d*i
    k -= i
    if k%2==1:
        if abs(x-d)<abs(x+d):
            print(abs(x-d))
        else:
            print(abs(x+d))
    else:
        print(abs(x))
    return

if __name__=='__main__':
    x,k,d = IL()
    solve()

Buggy submission (verdict: Runtime Error):
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    global x,k,d
    if d==0:
        print(abs(x))
        return
    if x > 0:
        i = x//d
        if i<k:
            x -= d*i
        else:
            print(x-d*k)
            return
    elif x<0:
        i = -x//d
        if i<k:
            x += d*i
        else:
            print(abs(x+d*k))
            return
    else:
        if k%2==1:
            print(abs(d))
        else:
            print(0)
            return
    
    k -= i
    if k%2==1:
        if abs(x-d)<abs(x+d):
            print(abs(x-d))
        else:
            print(abs(x+d))
    else:
        print(abs(x))
    return

if __name__=='__main__':
    x,k,d = IL()
    solve()

Buggy submission (verdict: Runtime Error):
import sys
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    global x,k,d
    if x > 0:
        i = x//d
        if i<k:
            x -= d*i
        else:
            print(x-d*k)
            return
    elif x<0:
        i = -x//d
        if i<k:
            x += d*i
        else:
            print(abs(x+d*k))
            return
    else:
        if k%2==1:
            print(abs(d))
        else:
            print(0)
            return
    
    k -= i
    if k%2==1:
        if abs(x-d)<abs(x+d):
            print(abs(x-d))
        else:
            print(abs(x+d))
    else:
        print(abs(x))
    return

if __name__=='__main__':
    x,k,d = IL()
    solve()
Problem p02639 (python)

Fixed submission:
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x = LI()
    for i in range(len(x)):
        if x[i] == 0:
            print(i+1)
            exit()
    return

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x = LS()
    for i in len(x):
        if x[i] == '0':
            print(i)
            exit()
    return

if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    x = SL()
    ans = 0
    for i in len(x):
        if x[i] == '0':
            print(i)
            exit()
    return

if __name__=='__main__':
    main()
Problem p02642 (python)

Fixed submission:
import sys

def solve(a,n):
    m = a[-1]+1
    ava = [0]*m
    for rep in a:
        ava[rep] += 1
        if ava[rep]:
            for i in range(2*rep,m,rep):
                ava[i] += 2
    return ava.count(1)
 
if __name__=='__main__':
    n = int(sys.stdin.readline().rstrip())
    a = list(map(int,sys.stdin.readline().rstrip().split()))
    a.sort()
    print(solve(a,n))

Buggy submission (verdict: Runtime Error):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    m = a[-1]+1
    ava = [0]*m
    for rep in a:
        ava[rep] += 1
        if ava[rep]==1:
            for item in range(rep,n+1,rep):
                ava[item] == 2

    print(ava.count(1))
    return

if __name__=='__main__':
    n = I()
    a = list(IL())
    a.sort()
    solve()

Buggy submission (verdict: Runtime Error):
import sys
from numba import njit

@njit(cache+True)
def solve(a,n):
    ava = [0]*a[-1]
    for i in range(n):
        for j in range(n):
            if a[j]%a[i]==0 and ava[a[j]-1]<2:
                ava[a[j]-1] += 1
    return ava.count(1)
 
if __name__=='__main__':
    n = int(sys.stdin.readline().rstrip())
    a = list(map(int,sys.stdin.readline().rstrip().split()))
    a.sort()
    print(solve(a,n))

Buggy submission (verdict: Runtime Error):
import sys 
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def main():
    n = I()
    a = LI()
    ava = [1]*n

    for i in range(n):
        x = a[i]
        for j in range(i+1,n):
            print(ava)
            if not ava[i] and not ava[j]:
                break
            y = a[j]
            if ava[i]:
                if not x%y:
                    ava[i] = 0
            if ava[j]:
                if not y%x:
                    ava[j] = 0    
    print(ava.count(1))
    return
 
if __name__=='__main__':
    main()
Problem p02647 (python)

Fixed submission:
import sys
from itertools import accumulate

def solve(n,k,a):
    for _ in range(k):
        if a==[n]*n:    return a
        t = [0]*(n+1)
        for i,x in enumerate(a):
            t[max(0,i-x)] += 1
            t[min(n,i+x+1)] -=1
        a = list(accumulate(t))[:-1]
    return a

n,k = map(int,sys.stdin.readline().rstrip().split())
a = list(map(int,sys.stdin.readline().rstrip().split()))

print(*solve(n,k,a))

Buggy submission (verdict: Runtime Error):
import sys 
from collections import deque
import numpy as np
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def R(x):
    r = round(x)
    if r+0.5 <= x:
        r += 1
    return int(r)

def main():
    tmp = deque(LI())
    n,k = tmp.popleft(),tmp.popleft()
    a = LI()
    for _ in range(k):
        table = np.zeros(n)
        for j in range(n):
            left = R(max(0,j-a[j]-0.5))
            right = int(min(n-1,j+a[j]+0.5))
            table[left:right+1] += 1
        a = table[:]
    for i in range(n):
        print(str(a[i])+' ',end='')
    return

if __name__=='__main__':
    main()
Problem p02657 (python)

Fixed submission:
from sys import stdin
from copy import deepcopy

def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
def LS(): return list(stdin.readline().rstrip().split())
def LI(): return list(map(int,stdin.readline().rstrip().split()))
def R(x):
    r = round(x)
    if r+0.5 <= x:
        r += 1
    return r

tmp = LI()

print(tmp[0]*tmp[1])

Buggy submission (verdict: Runtime Error):
from sys import stdin
from copy import deepcopy

def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
def LS(): return list(stdin.readline().rstrip().split())
def LI(): return list(map(int,stdin.readline().rstrip().split()))
def R(x):
    r = round(x)
    if r+0.5 <= x:
        r += 1
    return r

a,b = I(),I()

print(a*b)
Problem p02665 (python)

Fixed submission:
from sys import stdin
from collections import deque
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))
 
def end():
    print(-1)
    exit()
 
def main():
    n = I()
    a = deque(LI())
    if n==0:
        if a[0] == 1:
            print(1)
            exit()
        else:
            end()
    elif a[0]!=0:
        end()

    b = [0]*(n+1)
    for i in range(n,-1,-1):
        if i == n:
            b[i] = a[i]
        else:
            b[i] = min(b[i+1]+a[i],2**i)

    for i in range(n+1):
        if i!=0:
            b[i] = min(2*(b[i-1]-a[i-1]),b[i])
        if b[i]<a[i]:
            end()
    print(sum(b))
    return
 
if __name__=='__main__':
    main()

Buggy submission (verdict: Runtime Error):
from sys import stdin
from collections import deque
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))
 
def end():
    print(-1)
    exit()
 
def main():
    n = I()
    deq = deque(LI())
    if n==0:
        if deq[0] == 0:
            print(1)
            exit()
    if deq[0]!=0:
        end()
    max = deque()
    for i in range(n,-1,-1):
        if 2**i<deq[i]:
            end()
        if i == n:
            max.appendleft(deq[i])
        else:
            max.appendleft(max[0]+deq[i])
    for i in range(n+1):
        max[i] = min(2**i,max[i])
        if i!=n and i!=0:
            max[i] = min(2*(max[i-1]-deq[i-1]),max[i])
    	if max[i]<deq[i]:
          end()
    print(sum(max))
    return
 
if __name__=='__main__':
    main()
Problem p02714 (python)

Fixed submission:
from sys import stdin
def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
 
n = I()
s = list(S())

r = s.count('R')
g = s.count('G')
b = s.count('B')
 
ans = r*g*b
for i in range(n-1):
    for j in range(1,n):
        if i-j<0 or n<=i+j:
            break
        else:
            if s[i-j]!=s[i] and s[i]!=s[i+j] and s[i-j]!=s[i+j]:
                ans-=1
 
print(ans)

Buggy submission (verdict: Runtime Error):
from numba import njit
from sys import stdin
def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())
 
@njit
def main():
    n = I()
    s = list(S())
    ans = 0
    for i in range(n-2):
        color = {s[i]}
        for j in range(i+1,n-1):
            if not s[j] in color:
                color.add(s[j])
                for k in range(j+1,n):
                    if not s[k] in color:
                        if k-j != j-i:
                            ans += 1
                color = {s[i]}
    
    print(ans)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def S(): return stdin.readline().rstrip()
def I(): return int(stdin.readline().rstrip())


n = I()
s = S()

ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        if s[i] != s[j]:
            for k in range(j+1,n):
                if s[k] != s[i] and s[k] != s[j]:
                    if j-i != k-j:
                        ans += 1

print(ans)
Problem p02838 (python)

Fixed submission:
from sys import stdin
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

if __name__=='__main__':
    mod = 10**9 + 7
    n = I()
    a = LI()
    ans = 0
    for i in range(60):
        c1 = 0
        for rep in a:
            if (rep>>i)&1:
                c1 += 1
        ans += ((n-c1)*c1*(2**i)%mod)%mod
    print(ans%mod)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

if __name__=='__main__':
    mod = 1000000007
    n = I()
    a = LI()
    a.sort(reverse=True)
    ans = 0
    dig = int(math.log2(a[0])) + 1
    for i in range(dig):
        c0 = 0
        c1 = 0
        for rep in a:
            if (rep>>i)&1:
                c1 += 1
            else:
                c0 += 1
        ans += (c0*c1*2**i)%mod
    ans %= mod
    print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

if __name__=='__main__':
    mod = 1000000007
    n = I()
    a = LI()
    a.sort(reverse=True)
    ans = 0
    dig = int(math.log2(a[0])) + 1
    for i in range(dig):
        c0 = 0
        c1 = 0
        for rep in a:
            if (rep>>i)&1:
                c1 += 1
            else:
                c0 += 1
        ans += (c0*c1*2**i)%mod
    	ans %= mod
    print(ans)

Buggy submission (verdict: Runtime Error):
from sys import stdin
import math
from collections import deque
def I(): return int(stdin.readline().rstrip())
def LI(): return list(map(int,stdin.readline().rstrip().split()))

def main():
    mod = 10**9+7
    n = I()
    a = LI()
    a.sort(reverse=True)
    ans = 0
    dig = int(math.log2(a[0])) + 1
    for i in range(dig):
        c0 = 0
        c1 = 0
        for rep in a:
            if (rep>>i)&1:
                c1 += 1
            else:
                c0 += 1
        ans += c0*c1*2**i
    ans %= mod
    print(ans)
    return

if __name__=='__main__':
    main()
Problem p02842 (python)

Fixed submission:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    f = math.ceil(n/1.08)
    if math.floor(f*1.08)==n:
        print(f)
    else:
        print(':(')
    return

if __name__=='__main__':
    n = I()
    solve()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    f = math.ceil(m/1.08)
    if math.floor(f*1.08)==n:
        print(f)
    else:
        print(':(')
    return

if __name__=='__main__':
    n = I()
    solve()
Problem p03471 (python)

Fixed submission:
from sys import stdin
def LI(): return list(map(int,stdin.readline().rstrip().split()))
 
inp = LI()
n,Y = [inp.pop(0) for _ in range(2)]

Y = Y//1000
for i in range(n,-1,-1):
    if 10*i<=Y:
        for j in range(n-i,-1,-1):
            tmp = 10*i+5*j+n-i-j
            if tmp == Y:
                print(str(i)+' '+str(j)+' '+str(n-i-j))
                exit()
            elif tmp < Y:
                break

print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
from sys import stdin
def LI(): return list(map(int,stdin.readline().rstrip().split()))

inp = LI()
n,y = [inp.pop(0) for _ in range(2)]

y /= 1000

a = y//10
b = (y-a*10)//5
c = y-a*10-b*5

if a+b+c<=n:
    print(f'{int(a)} {int(b)} {int(c)}')
else:
    print('-1 -1 -1')
Problem p03854 (python)

Fixed submission:
from sys import stdin
def S(): return stdin.readline().rstrip()

a = S()
strl = ['dream','dreamer','erase','eraser']
t = ''
for i in range(len(a)-1,-1,-1):
    if 7<len(t):
        print('NO')
        exit()
    else:
        t = a[i]+t
        if t in strl:
            t = ''

print('YES')

Buggy submission (verdict: Runtime Error):
from sys import stdin
def S(): return stdin.readline().rstrip()

a = S()
def f(t,a):
    if t == a:
        return True
    elif len(a)<len(t):
        return False
    else:
        strl = {0:'dream',1:'dreamer',2:'erase',3:'eraser'}
        for i in range(4):
            tmp = strl[i]
            if t+tmp in a[:len(t+tmp)]:
                if f(t+tmp,a):
                    return True
        return False

if f('',a):
    print('YES')
else:
    print('NO')
Problem p02606 (python)

Fixed submission:
import math
a,b,d = map(int,input().split())
c=0
for i in range(a,b+1):
    if i%d==0:
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
import math
a,b,d = map(int,input().split())
c=0
for i in range(l,r+1):
  if i%d==0:
    c+=1
print(c)
Problem p02658 (python)

Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
t=1
arr.sort()
for i in range(n):
    t*=arr[i]
    if arr[i]==0:
        t=0
        break
    elif t>10**18:
        t=-1
        break
print(t)

Buggy submission (verdict: Runtime Error):
n=int(input())
arr=list(map(int,input().split()))
t=1
for i in range(n):
  if arr[i]==0:
    t=0
    break
   elif t>10**18:
    t=-1
    break
  t*=arr[i]
  
print(t)