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

Fixed submission:
x,y,z,K=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans=[]
for i in range(x):
  for j in range(y):
    for k in range(z):
      if (i+1)*(j+1)*(k+1)<=K:
        ans.append(a[i]+b[j]+c[k])
      else:
        break
ans.sort(reverse=True)
for i in range(K):
  print(ans[i])

Buggy submission (verdict: Runtime Error):
x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
t = []
for i in range(x):
    for j in range(y):
        for l in (range(z):
            if (i+1) * (j+1) * (l+1) <= k:
                t.append(a[i]+b[j]+c[l])
            else:
                break
t.sort(reverse=True)
for i in range(k):
    print(t[i])

Buggy submission (verdict: Runtime Error):
x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans = []
for i in set(range(x)):
    for j in set(range(y)):
        for l in set(range(z)):
            if (i+1) * (j+1) * (l+1) <= k:
                ans.append(a[i]+b[j]+c[l])
            else:
                break
ans.sort(reverse=True)
for ans in range(k):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
x, y, z, k = map(int, input().split(' '))
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
c = list(map(int, input().split(' ')))
taste = []
for i in range(x - 8 if x - 8 < 0 else 0, x):
    for j in range(y - 8 if x - 8 < 0 else 0, y):
        for l in range(z - 8 if x - 8 < 0 else 0, z):
            taste.append(a[i] + b[j] + c[l])
taste.sort()
for i in range(k):
    print(taste[-1-i])
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s = input()
t = [0] * (n + 1)
nl = set(range(n))
for i in nl:
    t[i + 1] = t[i] + (1 if s[i:i + 2] == 'AC' else 0)
ql = set(range(q))
for i in ql:
    l1, l2 = map(int, input().split())
    ans = t[l2-1] - t[l1-1]
    print(ans)

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
t = [0] * (n + 1)
nl = set(range(nl))
for i in nl:
    t[i + 1] = t[i] + (1 if s[i:i + 2] == 'AC' else 0)
ql = set(range(q))
for i in ql:
    l1, l2 = map(int, input().split())
    ans = t[l2-1] - t[l1-1]
    print(ans)
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
ans = [e for e in range(1, min(a, b) + 1) if (a % e) + (b % e) == 0]
print(ans[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans = [e for e in range(1, min(a, b) // 2 + 1) if (a % e) + (b % e) == 0]
print(ans[-k])
Problem p03112 (python)

Fixed submission:
import bisect


A, B, Q = map(int, input().split())
s = [-10 ** 12] + [int(input()) for _ in range(A)] + [10 ** 12]
t = [-10 ** 12] + [int(input()) for _ in range(B)] + [10 ** 12]
x = [int(input()) for _ in range(Q)]
for i in x:
    si = bisect.bisect_left(s, i)
    ti = bisect.bisect_left(t, i)
    s1, s2 = s[si - 1], s[si]
    t1, t2 = t[ti - 1], t[ti]
    ans = 10 ** 12
    for ss in [s1, s2]:
        for tt in [t1, t2]:
            ans = min(ans, abs(i - ss) + abs(ss - tt),
                      abs(i - tt) + abs(ss - tt))
    print(ans)

Buggy submission (verdict: Runtime Error):
import bisect


A, B, Q = map(int, input().split())
s = [-10 ** 9] + [int(input()) for _ in range(A)] + [10 ** 9]
t = [-10 ** 9] + [int(input()) for _ in range(B)] + [10 ** 9]
x = [int(input()) for _ in range(Q)]
for i in x:
    si = bisect.bisect_left(s, i)
    ti = bisect.bisect_left(t, i)
    s1, s2 = s[si - 1], s[si]
    t1, t2 = t[ti - 1], t[ti]
    ans = 10 ** 9
    for ss in [s1, s2]:
        for tt in [t1, t2]:
            ans = min(ans, abs(i - ss) + abs(ss - tt),
                      abs(i - tt) + abs(ss - tt))
    print(ans)
Problem p03160 (python)

Fixed submission:
def a():
    N = int(input())
    h = list(map(int, input().split()))
    dp = [10 ** 9] * (N + 1)
    dp[0] = 0
    for i in range(1, N):
        dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))
        if i > 1:
            dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))
    return dp[i]

  
if __name__ == '__main__':
    ans = a()
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
h = list(map(int, input().split()))
dp = [10**9] * (N + 1)


def f(i):
    if dp[i] < 10 ** 9:
        return dp[i]
    if i == 0:
        return 0
    else:
        v1 = f(i - 1) + abs(h[i] - h[i - 1])
        if i >= 2:
            v2 = f(i - 2) + abs(h[i] - h[i - 2])
        else:
            v2 = 10 ** 9
        dp[i] = min(v1, v2)
    return dp[i]


if __name__ == '__main__':
    ans = f(N - 1)
    print(ans)
Problem p03162 (python)

Fixed submission:
def c():
    N = int(input())
    abc = [list(map(int, input().split())) for _ in range(N)]
    dp = [[0] * N for _ in range(3)]
    dp[0][0], dp[1][0], dp[2][0] = abc[0][0], abc[0][1], abc[0][2]
    i = 0
    for i in range(1, N):
        dp[0][i] = max(dp[1][i - 1] + abc[i][0], dp[2][i - 1] + abc[i][0])
        dp[1][i] = max(dp[0][i - 1] + abc[i][1], dp[2][i - 1] + abc[i][1])
        dp[2][i] = max(dp[0][i - 1] + abc[i][2], dp[1][i - 1] + abc[i][2])
    return max(dp[0][i], dp[1][i], dp[2][i])


if __name__ == '__main__':
    ans = c()
    print(ans)

Buggy submission (verdict: Runtime Error):
def c():
    N = int(input())
    abc = [list(map(int, input().split())) for _ in range(N)]
    dp = [[0] * N for _ in range(3)]
    for i in range(N):
        dp[0][i] = max(dp[1][i - 1] + abc[i][0], dp[2][i - 1] + abc[i][0])
        dp[1][i] = max(dp[0][i - 1] + abc[i][1], dp[2][i - 1] + abc[i][1])
        dp[2][i] = max(dp[0][i - 1] + abc[i][2], dp[1][i - 1] + abc[i][2])
    return max(dp[:][i])


if __name__ == '__main__':
    ans = c()
    print(ans)
Problem p03164 (python)

Fixed submission:
def e():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for _ in range(N)]
    v = [wv[i][1] for i in range(len(wv))]
    V = sum(v)
    dp = [[10 ** 9] * (V + 1) for _ in range(N + 1)]
    dp[0][0] = 0
    for i in range(N):
        for j in range(V + 1):
            if j - wv[i][1] >= 0:
                dp[i + 1][j] = min(dp[i + 1][j],
                                   dp[i][j - wv[i][1]] + wv[i][0])
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
    for k, p in enumerate(dp[-1]):
        if p <= W:
            r = k
    return r


if __name__ == '__main__':
    ans = e()
    print(ans)

Buggy submission (verdict: Runtime Error):
def e():
    N, W = map(int, input().split())
    wv = [list(map(int, input().split())) for _ in range(N)]
    dp = [[0] * (W + 1) for _ in range(N + 1)]
    for i in range(N):
        for j in range(W + 1):
            if j - wv[i][0] >= 0:
                dp[i + 1][j] = max(dp[i + 1][j],
                                   dp[i][j - wv[i][0]] + wv[i][1])
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
    return dp[-1][-1]


if __name__ == '__main__':
    ans = e()
    print(ans)
Problem p03166 (python)

Fixed submission:
def g():
    from collections import defaultdict
    import sys

    sys.setrecursionlimit(10 ** 6)
    N, M = map(int, input().split())
    xy = defaultdict(list)
    memo = {}
    for _ in range(M):
        x, y = map(int, input().split())
        xy[x].append(y)

    def g2(x):
        if x in memo:
            return memo[x]
        else:
            r = 0
            for ny in xy[x]:
                r = max(r, g2(ny) + 1)
            memo[x] = r
        return r

    ans = 0
    for i in range(1, N + 1):
        ans = max(ans, g2(i))
    return ans


if __name__ == '__main__':
    ans = g()
    print(ans)

Buggy submission (verdict: Runtime Error):
def g():
    from collections import defaultdict
    N, M = map(int, input().split())
    xy = defaultdict(list)
    memo = defaultdict(list)
    for _ in range(M):
        x, y = map(int, input().split())
        xy[x].append(y)

    def g2(x):
        if x in memo:
            return memo[x]
        else:
            r = 0
            for ny in xy[x]:
                r = max(r, g2(ny) + 1)
            memo[x] = r
        return r

    ans = 0
    for i in range(N):
        ans = max(ans, g2(i))
    return ans


if __name__ == '__main__':
    ans = g()
    print(ans)

Buggy submission (verdict: Runtime Error):
def g():
    from collections import defaultdict
    N, M = map(int, input().split())
    xy = defaultdict(list)
    memo = defaultdict(list)
    for _ in range(M):
        x, y = map(int, input().split())
        xy[x].append(y)

    def g2(x):
        if x in memo:
            return memo[x]
        else:
            r = 0
            for ny in xy[x]:
                r = max(r, g2(ny) + 1)
            memo[x] = r
        return r

    ans = [g2(i) for i in range(1, N + 1)]
    return max(ans)


if __name__ == '__main__':
    ans = g()
    print(ans)

Buggy submission (verdict: Runtime Error):
def g():
    from collections import defaultdict
    N, M = map(int, input().split())
    xy = defaultdict(list)
    for _ in range(M):
        x, y = map(int, input().split())
        xy[x].append(y)
    memo = {}

    def g2(x):
        if x in memo:
            return memo[x]
        else:
            r = 0
            for ny in xy[x]:
                r = max(r, g2(ny) + 1)
            memo[x] = r
        return r

    ans = [g2(i) for i in range(1, N + 1)]
    return max(ans)


if __name__ == '__main__':
    ans = g()
    print(ans)
Problem p03105 (python)

Fixed submission:
import math

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

required = a * c
limit = b

if required <= limit:
    print(c)
else:
    print(math.floor(b / a))

Buggy submission (verdict: Runtime Error):
string = input()
one = 0
zero = 0
for s in string:
    if s == '1':
        ones += 1
    else:
        zeros += 1

print(2*min(one, zero))
Problem p02983 (python)

Fixed submission:
from itertools import combinations
L, R = map(int, input().split())
if (L % 2019 > R % 2019) or R - L >=2019:
    print(0)
else:
    ans = 2018
    for i, j in combinations(range(L, R + 1), 2):
        a = i % 2019
        b = j % 2019
        mod = (a * b) % 2019
        if ans > mod:
            ans = mod
    print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
L, R = map(int, input().split())
ans = 2018
for i, j in combinations(range(L, R + 1), 2):
    a = i % 2019
    b = j % 2019
    mod = (a * b) % 2019
    if ans > mod:
        ans = mod
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions
A, B, C, D = map(int, input().split())
G = C * D // fractions.gcd(C, D)
ag = (A - 1) // G
ac = (A - 1) // C
ad = (A - 1) // D
bg = B // G
bc = B // C
bd = B // D
print((B - A + 1) - ((bc + bd - bg) - (ac + ad - ag)))

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
G = C * D // math.gcd(C, D)
ag = (A - 1) // G
ac = (A - 1) // C
ad = (A - 1) // D
bg = B // G
bc = B // C
bd = B // D
print((B - A + 1) - ((bc + bd - bg) - (ac + ad - ag)))
Problem p03556 (python)

Fixed submission:
N = int(input())
ans = 1
for i in range(N):
    if i * i > N:
        ans = (i - 1) ** 2
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(N):
    if i * i > N:
        ans = (i - 1) ** 2
        break
print(ans)
Problem p02909 (python)

Fixed submission:
s = input()
 
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s = input()

if s = 'Sunny':
  print('Cloudy')
elif s = 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Problem p03212 (python)

Fixed submission:
n=int(input())

def dfs(s):
  if n<int(s) : return 0
  res = 1 if all(s.count(c)>0 for c in "753") else 0
  for i in "753":
    res += dfs(s+i)
  return res

print(dfs("0"))

Buggy submission (verdict: Runtime Error):
n=int(input())

def dfs(s):
  if n<int(s) : return 0
  res = if all(s.count(c)>0 for c in "753") : 1 else 0
  for i in "753":
    res += dfs(s+i)
  return res

print(dfs("0"))

Buggy submission (verdict: Runtime Error):
n=int(input())

def dfs(s):
  if n<int(s) : return 0
  res = if all(s.count(c) for c in "753") : 1 else 0
  for i in "753":
    res += dfs(s+i)
  return res

print(dfs("0"))
Problem p03475 (python)

Fixed submission:
n=int(input())
c=[0]*(n-1);s=[0]*(n-1);f=[0]*(n-1)
for i in range(n-1):
  c[i],s[i],f[i]=map(int,input().split())
  
for i in range(n):
  ans=0
  for j in range(i,n-1):
    if ans <= s[j] :
      ans = s[j] + c[j]
    elif ans%f[j] == 0:
      ans += c[j]
    else:
      ans += c[j] + (f[j]-ans)%f[j]
  print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
c=[0]*n;s=[0]*n;f=[0]*n
for i in range(n):
  c[i],s[i],f[i]=map(int,input().split())
  
for i in range(n):
  ans=0
  for j in range(i,n):
    ans+=c[i]+(s[i]+f[i]-ans)%f[i]
  print(ans)
Problem p03636 (python)

Fixed submission:
s=input()
num=len(s)-2
print(s[0], num, s[num+1], sep="")

Buggy submission (verdict: Runtime Error):
s=input()
num=len(s)-2
print(s[0]+num+s[num+1])
Problem p04043 (python)

Fixed submission:
N=input()
N=N.split()
sum=0
flag1=0
flag2=0
for i in N:
    if(i=="5"):
        flag1=1
    if(i=="7"):
        flag2=1
    sum=sum+int(i)
if(sum == 17 and flag1 == 1 and flag2 == 1):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
NL=input().split()
N=int(NL[0])
L=int(NL[1])

S=[]
rank=[]
for i in range(N):
    S.append(input())
    rank.append(0)
temp=[]
for i in range(N):
    for j in range(N):
        if(S[i]<S[j]):
           temp.append(int(1))
        else:
            temp.append(int(0))        

for i in range(N*N):
    a=i%N
    rank[a]+=temp[i]
j=0
moji=""
for i in range(N):
    for j in range(N):
        if(i==rank[j]):
            moji=moji+S[j]
print(moji)

Buggy submission (verdict: Runtime Error):
NL=input().split()
N=int(NL[0])
L=int(NL[1])

S=[]
rank=[]
for i in range(N):
    S.append(input())
    rank.append(0)
temp=[]
for i in range(N):
    for j in range(N):
        if(S[i]<S[j]):
           temp.append(int(1))
        else:
            temp.append(int(0))        

for i in range(N*N):
    a=i%N
    rank[a]+=temp[i]
j=0
moji=""
for i in range(N):
    for j in range(N):
        if(i==rank[j]):
            moji=moji+S[j]
print(moji)
Problem p02861 (python)

Fixed submission:
import math
N= int(input())
x=[0]*N
y=[0]*N
for i in range(N):
  x[i], y[i]=map(int, (input()).split() )
S = 0
nb =0
for i in range(N) :
  for j in range(0, i) :
    S += math.sqrt( (x[i]-x[j])**2 + (y[i]-y[j])**2 )
    nb += 1
print(S/nb*(N-1))

Buggy submission (verdict: Runtime Error):
import math
N= int(input())
x=[0]*N
y=[0]*N
for i in range(N):
  X[i]=int(input())
  y[i]=int(input())
S = 0
nb =0
for i in range(N) :
  for j in range(0, i) :
    S += math.sqrt( (x[i]-x[j])**2 + (y[i]-y[j])**2 )
    nb += 1
print(S/nb*(nb-1))

Buggy submission (verdict: Runtime Error):
import math
N= int(input())
x=[0]*N
y=[0]*N
for i in range(N):
  X[i]=int(input())
  y[i]=int(input())
S = 0
nb =0
for i in range(N) :
  for j in range(0, i) :
    S += math.sqrt( (x[i]-x[j])**2 + (y[i]-y[j])**2 )
    nb += 1
print(S/nb)
Problem p02882 (python)

Fixed submission:
from math import atan, pi
a,b,x = [int(i) for i in input().split()]




ocupado = x/(a*a)



if ocupado == b:
    alfa = pi/2

elif ocupado*2 >= b:
    sobra = b - ocupado

    #alfa = atan(sobra/ocupado)
    alfa = atan(a / (2*(b-ocupado)))
else:
    alfa = atan((2*a*ocupado) / (b*b))
print("%.10f" %(90 - alfa*180/pi))

Buggy submission (verdict: Runtime Error):
from math import atan, pi
a,b,x = [int(i) for i in input().split()]




ocupado = x/(a*a)

if ocupado*2 >= b:
    sobra = b - ocupado

    #alfa = atan(sobra/ocupado)
    alfa = atan(a / (2*(b-ocupado)))
else:
    alfa = atan((2*a*ocupado) / (b*b))
print("%.10f" %(90 - alfa*180/pi))
Problem p02921 (python)

Fixed submission:

s = input()
t = input()

list(s)
list(t)

if s[0] == t[0] and s[1] == t[1] and s[2] == t[2]:
    print(3)

elif s[0] == t[0] and s[1] == t[1] and s[2] != t[2]:
    print(2)

elif s[0] == t[0] and s[1] != t[1] and s[2] == t[2]:
    print(2)

elif s[0] != t[0] and s[1] == t[1] and s[2] == t[2]:
    print(2)

elif s[0] == t[0] and s[1] != t[1] and s[2] != t[2]:
    print(1)

elif s[0] != t[0] and s[1] != t[1] and s[2] == t[2]:
    print(1)

elif s[0] != t[0] and s[1] == t[1] and s[2] != t[2]:
    print(1)

else:
    print(0)

Buggy submission (verdict: Runtime Error):

A = int(input())
B = int(input())

x = ((B-1) // (A-1))+1
print(x)

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())

x = ((B-1) / (A-1))+1
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())

x = (b-1) / (a-1)

print(math.ceil(x))
Problem p02922 (python)

Fixed submission:
import math
A, B = list(map(int, input().split()))
print(math.ceil((B-1)/(A-1)))

Buggy submission (verdict: Runtime Error):
import math
 
a = int(input())
b = int(input())
print(math.ceil((b-1) / (a-1)))

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())

x = ((B-1) // (A-1))+1
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())

x = ((B-1) / (A-1))+0
print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())
if a >= 2 and B>= 1:
    x = (B-1) / (A-1)

    print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())
if a >= 2 and B>= 1
    x = (B-1) / (A-1)

    print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

A = int(input())
B = int(input())

x = (B-1) / (A-1)

print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())

x = (b)/(a-1)

print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())

x = (b-1) / (a-1)

print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
import math

a = int(input())
b = int(input())

x = (b-1) / (a-1)

print(math.ceil(x))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

x = b//(a-1)

print(x)
Problem p04043 (python)

Fixed submission:
a=input().split()
if a.count('5')==2 and a.count('7')==1:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
 
 
 
if a == 5 and b == 5 and c == 7:
    print("YES")
 
elif a == 5 and b == 7 and c == 5:
    print("YES")
 
elif a == 7 and b == 5 and c == 5:
    print("YES")
 
 
    
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
A.sort()
#A = str(len("a"))
#B = str(len("b"))
#C = str(len("c"))

if A == [5,5,7]:
    print("YES"

else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())



if A == 5 and B == 5 and C == 7:
    print("YES")

elif A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")


    
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

#A = str(len("a"))
#B = str(len("b"))
#C = str(len("c"))

if A == 5 and B == 5 and C == 7:
    print("YES")

elif A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 7:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")
    
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

if A == 5 and B == 5 and C == 7:
    print("YES")

elif A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 7:
    print("YES")

elif A == 7 and B == 7 and C == 5:
    print("YES")
    
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

if A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")

elif A == 5 and B == 5 and C == 7:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())

if A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")

elif A == 5 and B == 5 and C == 7:
    print("YES")
    
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())



if A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")

elif A == 5 and B == 5 and C == 7:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
1 = input()
2 = input()
3 = input()

A = len(1)
B = len(2)
C = len(3)

if A == 5 and B == 7 and C == 5:
    print("YES")

elif A == 7 and B == 5 and C == 5:
    print("YES")

elif A == 5 and B == 5 and C == 7:
    print("YES")
else:
    print("NO")
Problem p03145 (python)

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

print(int(a) * int(b) // 2)

Buggy submission (verdict: Runtime Error):
def f(a):
  if a%2 == 0:
    return a//2
  else:
    return 3*a+1

s = int(input())
a = [s]
i=2
 
while(True):
  a.append(f(a[i-2]))
  if a[i-1] in a[:i-1]:
    print(i)
    break
  i=i+1
Problem p03471 (python)

Fixed submission:
def a():
 n, m = [int(i) for i in input().split()]
 for x in range(n+1):
  for y in range(n-x+1):
    z = n-x-y
    
    if 1000*x + 5000*y + 10000*z == m:
      print('%d %d %d'%(z,y,x))
      return
 print('-1 -1 -1')
    
a()

Buggy submission (verdict: Runtime Error):
def a():
 n, m = [int(i) for i in input().split()]
 for x in range(1,n+):
  for y in range(1, n-x+1):
    z = n-x-y
    
    if 1000*x + 5000*y + 10000*z == m:
      print('%d %d %d'%(x,y,z))
      return
 print('-1 -1 -1')
    

a()
#  1000x + 5000y + 10000z = m
#  x + y + z = n
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=input().split()

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

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

if a[0]==b[-1] anb [0] == c[-1]:
  print('YES')
else:
  print('NO')
Problem p02900 (python)

Fixed submission:
def resolve():
    a, b = map(int, input().split())
    div_a = set(prime_factorize(a))
    div_b = set(prime_factorize(b))
    print(len(div_a & div_b) + 1)
    # print(div_a)
    # print(div_b)


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    a, b = map(int, input().split())
    ps = primes(int(min(a, b) ** 0.5))
    ans = [pi for pi in ps if a % pi == 0 and b % pi == 0]
    print(len(ans) + 1)
    
    
if __name__ == "__main__":
    resolve()
Problem p02983 (python)

Fixed submission:
from itertools import combinations
import math


def solve():
    l, r = map(int, input().split())
    a = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            amari = (i * j) % 2019
            if amari == 0:
                return 0
            elif amari < a:
                a = amari
    return a


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
from itertools import combinations
import math


def solve():
    l, r = map(int, input().split())
    a = 2018
    for i, j in combinations(range(l, r + 1), 2):
        amari = (i * j) % 2019
        if amari == 0:
            return 0
        elif amari < a:
            a = amari
    return a


if __name__ == "__main__":
    print(solve())