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

Fixed submission:
import fractions
n,m = map(int,input().split())
print(n*m//fractions.gcd(n,m))

Buggy submission (verdict: Runtime Error):
import math
n,m = map(int,input().split())
print(n*m//math.gcd(n,m))
Problem p02571 (python)

Fixed submission:
s = input() #efabdd
t = input() #abcd
sl = len(s) #6
tl = len(t) #4
ans = tl #4
for i in range(sl-tl+1): #6-4+1 => 0, 1, 2
    c = 0
    for j in range(min(tl, sl)): #min(4, 6) => 4
        if (s[i+j] != t[j]): #s[0] != t[0]..t[3]
            c += 1
    ans = min(c, ans) #min(0..4, 4)
print(ans)

Buggy submission (verdict: Runtime Error):
s = input() #efabdd
t = input() #abcd
sl = len(s) #6
tl = input(t) #4
ans = tl #4
for i in range(sl-tl+1): #6-4+1 => 0, 1, 2
    c = 0
    for j in range(min(tl, sl): #min(4, 6) => 4
        if (s[i+j] != t[j]: #s[0] != t[0]..t[3]
            c += 1
    ans = min(c, ans) #min(0..4, 4)
print(ans)
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())

if (s > w):
    print("safe")
else:
    print("unsafe")

Buggy submission (verdict: Runtime Error):
import sys

S = input()

s = []
for i in S:
    s.append(int(i))
count = 0

if (len(s) < 4 ):
    print(0)
    sys.exit()

for i in range(len(s)):
    j = i
    target = s[i]
    for k in range(len(s)-i):
        j += 1
        if(j >= len(s)):
            break
        target = target*10
        target += s[j]
        if ( target%2019 == 0):
            count += 1
print(count)
Problem p02859 (python)

Fixed submission:
from sys import stdin

a = stdin.readline().rstrip()
a = int(a)
print(a*a)

Buggy submission (verdict: Runtime Error):
import sys

args = sys.argv[1]
args = int(args)
print(args*args)

Buggy submission (verdict: Runtime Error):
args = sys.argv[1]
print(args*args)
Problem p02623 (python)

Fixed submission:
import numpy
import bisect
n,m,k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]+list(numpy.cumsum(A))
b = [0]+list(numpy.cumsum(B))
ans = 0
# print(a,b)
for i in range(len(a)):
    x = k - a[i]
    if x >= 0:
        j = bisect.bisect_right(b,x)-1
        ans = max(ans, i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
n,m,k = map(int, input().split())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))
a,b = A.popleft(), B.popleft()
ans = 0
ok = False
while k > 0:
    if ok: break
    if a < b and k-a >= 0:
        k -= a
        ans += 1
        if A: a = A.popleft()
        else: a = float("INF")
    elif a > b and k-b >= 0:
        k -= b
        ans += 1
        if B: b = B.popleft()
        else: b = float("INF")
    elif a == b:
        for i in range(min(len(A), len(B))):
            if A[i] == B[i]:
                if k-A[i] >=0: 
                    k-= A[i]
                    ans += 1
                else: 
                    ok = True
            elif A[i] < B[i] and k-A[i] >= 0:
                k -= A[i]
                ans += 1
                A = deque(list(A)[i+1:])
            elif A[i] > B[i] and k-B[i]>=0:
                k -= B[i]
                ans += 1
                B = deque(list(B)[i+1:])
            else: ok = True
    else: break
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
n,m,k = map(int, input().split())
A = deque(map(int, input().split()))
B = deque(map(int, input().split()))

a,b = A.popleft(), B.popleft()
ans = 0
ok = False
while k > 0:
    if ok: break
    if a < b and k-a >= 0:
        k -= a
        ans += 1
        if A: a = A.popleft()
        else: a = float("INF")
    elif a > b and k-b >= 0:
        k -= b
        ans += 1
        if B: b = B.popleft()
        else: b = float("INF")
    elif a == b:
        for i in range(min(len(A), len(B))):
            if A[i] == B[i]:
                if k-A[i] >=0: 
                    k-= A[i]
                    ans += 1
                else: 
                    ok = True
                continue
            if A[i] < B[i] and k-A[i] >= 0:
                k -= A[i]
                ans += 1
                A = A[i+1:]
            elif A[i] > B[i] and k-B[i]>=0:
                k -= B[i]
                ans += 1
                B = B[i+1:]
            else: ok = True
    else: break
print(ans)
Problem p02629 (python)

Fixed submission:
n = int(input())
x = [chr(i) for i in range(ord("a"), ord("z")+1)]
ans = []
while n > 26:
    ans.append(x[n%26-1])
    if n%26 == 0:
        n = n//26 -1
    else:n //= 26
ans.append(x[n-1])
print("".join(ans[::-1]))

Buggy submission (verdict: Runtime Error):
n = int(input())
x = [chr(i) for i in range(ord("a"), ord("z"))]
ans = []
while n > 26:
    ans.append(x[n%26-1])
    n //= 26
ans.append(x[n-1])
print("".join(ans[::-1]))
Problem p02785 (python)

Fixed submission:
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
for i in range(K):
  if len(H) <= 0:
    break
  H.pop(-1)
print(sum(H) if len(H) > 0 else 0)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
H = sorted(list(map(int, input().split())))
if k >= n: ans = 0
elif k == 0: ans = sum(H)
else: ans = sum(H[-k])
print(ans)
Problem p02831 (python)

Fixed submission:
import fractions
A, B = map(int, input().split())
print((A * B) // fractions.gcd(A, B))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print((A * B) // math.gcd(A, B))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
def lcm(x, y):
  return (x * y) // math.gcd(x, y)

print(lcm(A, B))

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

import math

def lcm(x, y):
  return (x * y) // math.gcd(x, y)

print(lcm(A, B))
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
if N > 1:
  if S[0: N // 2] == S[N // 2 :]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
n = 0
l = [S[0]]
if N > 1:
  for i in range(N):
    if not S[i+1] in l:
      l.append(S[i + 1])
    else:
      n = i + 1
      break
  if S[0:n] == S[n:]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p02891 (python)

Fixed submission:
s = list(input())
k = int(input())

if len(set(s)) == 1:
    print((len(s)*k)//2)
    exit()

def n_change(sss):
    s = sss.copy()
    x = 0
    for i in range(1, len(s)):
        if s[i] == s[i-1]:
            s[i] = "X"
            x += 1
    return x

print(n_change(s) + (k-1) * (n_change(2*s) - n_change(s)))

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())

cnt = 0
c = 0
if s[0] == s[-1]:
  if s[-1] == s[-2]: cnt +=1
  else: c +=1
  s[-1] = ""

for i in range(len(s)-1):
  if s[i] == s[i+1]:
    s[i+1] = ""
    cnt += 1
print(k*cnt + (k-1)*c)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]
BC.sort(reverse=True, key=lambda x:x[1])
A.sort()

ans = []
for b,c in BC:
  n = len(ans)
  for i in range(b):
    if n >  N-1: break
    if A[n] < c:
      ans.append(c)
      n += 1
    else: break

print(sum(ans) + sum(A[len(ans):]))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

a.sort()
bc.sort(reverse=True, key=lambda x:x[1])
i = 0
ans = 0
for b, c in bc:
    for _ in range(b):
        if a[i] < c:
            ans += c 
            i += 1
            if i > n-1: break
        else: break
print(ans + sum(a[i:]))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

a.sort()
bc.sort(reverse=True, key=lambda x:x[1])
i = 0
ans = 0
for b, c in bc:
    for _ in range(b):
        if a[i] < c:
            ans += c
            i += 1
        else: break
print(ans + sum(a[i:]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]
BC.sort(reverse=True, key=lambda x:x[1])
A.sort()

ans = []
for b,c in BC:
  n = len(ans)
  for i in range(b):
    if A[n] < c:
      ans.append(c)
      n += 1
    else: break

print(sum(ans) + sum(A[len(ans):]))
Problem p03705 (python)

Fixed submission:
n, a, b = map(int, input().split())
if a > b or (n == 1 and a != b):
    print(0)
else:
    print((b-a) * (n-2) + 1)

Buggy submission (verdict: Runtime Error):
import itertools
n, a, b = map(int, input().split())
if n < b-a:
    print(0)
    exit()
N = list(range(a, b+1))
su = []
if n > 2:
    for v in itertools.combinations_with_replacement(N, n-2):
        if not sum(v) in su: su.append(sum(v))
    ans = len(su)
else:
    A = b-a+1
    if n == 1: ans = A
    else: ans = A * (A-1) * (A-2) // 6
print(ans)
Problem p03774 (python)

Fixed submission:
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]

for i in range(N):
  d = []
  for j in range(M):
    d.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - cd[j][1]))
  print(d.index(min(d)) + 1)

Buggy submission (verdict: Runtime Error):
import bisect
n,m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
AB = sorted(ab)
for x,y in cd:
    a = bisect.bisect_left(AB, [x,y])
    print(ab.index(AB[a])+1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]

for i in range(N):
    d = []
    for j in range(M):
        d.append(abs(ab[i][0] - cd[j][0]) + abs(ab[i][1] - ab[j][1]))
    print(d.index(min(d)) + 1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
c = []
d = []
for _ in range(M):
    C, D = map(int, input().split())
    c.append(C)
    d.append(D)


I = []
for a, b in ab:
    n = 10 ** 8
    I_n = ""
    for i in range(M):
        if abs(a-c[i]) + abs(b-d[i]) < n:
            if not i in I:
                n = abs(a-c[i]) + abs(b-d[i])
                I_n = i
    print(I_n + 1)
    I.append(I_n)
Problem p02570 (python)

Fixed submission:
s = input()
l = s.split(' ')

if(int(l[0]) <= int(l[1]) * int(l[2])):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
d = int(input())
t = int(input())
s = int(input())

if d <= t * s:
	print("Yes")
else:
	print("No")
Problem p02754 (python)

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

if A == 0:
    print(0)
    exit()

x = int(N / (A+B))
y = N % (A+B)
z = 0
if y < A:
    z = y
else:
    z = A

blue = 0
if x < 10**100:
    blue = (x * A) + z
else:
    blue = 10*100*A + z
print(blue)

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

BLUE = "b"
RED = "r"


balls = ""
while True:
    if len(balls) >= N:
        break
    balls += BLUE*A
    balls += RED*B

print(len([ball for ball in list(balls)[0:N] if ball == BLUE]))
Problem p02577 (python)

Fixed submission:
#from functools import lru_cache
import sys
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

n=reader()[0][0]
i=vfunc(lambda n:int(n))(n)
print('Yes' if sum(i)%9==0 else 'No')

Buggy submission (verdict: Runtime Error):
#from functools import lru_cache
import sys
import numpy as np
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

n=int(reader()[0][0])
a=[]
for i in range(200001):
    a.append(n%10)
    n//=10
print('Yes' if sum(a)%9==0 else 'No')

Buggy submission (verdict: Runtime Error):
#from functools import lru_cache
import sys
from itertools import product,combinations
from functools import reduce,lru_cache
import heapq
import numpy as np
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def list_t(l): return vfunc(lambda *args:args)(*l)

def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

n=int(reader()[0][0])
a=[]
while n!=0:
    a.append(n%10)
    n//=10
print('Yes' if sum(a)%9==0 else 'No')
Problem p02578 (python)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
max=l[0]
c=0
for x in l:
    if max <x:
        max=x
    else:
        c+=(max-x)
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=map(int,input().spliut())
max=l[0]
c=0
for x in l:
    if max <x:
        max=x
    else:
        c+=(max-x)
print(c)
Problem p02659 (python)

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

if A == 0 or B == '0.00':
    ans = 0
else:
    ans = A*int(B[0])*100 + A*int(B[2])*10 + A*int(B[3])
    ans = str(ans)
    if len(ans)-2 <= 0:
        ans = 0
    else:
        ans = ans[0:len(ans)-2]
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(math.floor(A*B))
Problem p02701 (python)

Fixed submission:
N = int(input())

ans = set()
for i in range(N):
    ans.add(input())

print(len(ans))

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

ans = {}
for i in range(N):
    ans.add(input())

print(len(ans))
Problem p02773 (python)

Fixed submission:
n = int(input())
S = []
for _ in range(n):
    S.append(input())

d = {}
for s in S:
  if s in d:
    d[s] += 1
  else:
    d[s] = 1

list = []
max = max(d.values())
for k, v in d.items():
  if max == v:
    list.append(k)

list.sort()
for str in list:
  print(str)

Buggy submission (verdict: Runtime Error):
n = int(input())
S = []
for _ in range(n):
    S.append(input())

d = {}
for s in S:
  if s in d:
    d[s] += 1
  else:
    d[s] = 1

ans = 0
for i in d.values():
  if ans < i:
    ans = i

sor = sorted(d.keys())
for k, v in sor.items():
  if ans == v:
    print(k)
Problem p02771 (python)

Fixed submission:
a,b,c = map(int,input().split())
if (a==b and b!=c) or (a==c and c!=b) or (c==b and c!=a):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int,raw_input().split())
if a==b and b!=c:
  print("Yes")
elif a==c and c!=b:
  print("Yes")
elif c==b and c!=a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,raw_input().split())
if (a==b and b!=c) or (a==c and c!=b) or (c==b and c!=a):
  print("Yes")
else:
  print("No")
Problem p02777 (python)

Fixed submission:

s, t = input().split()
a,b = map(int, input().split())
u = input()
res = {
    s: a,
    t: b
}
res[u] -= 1
print(res[s], res[t])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split()
b = set(a)
if len(b)<len(a):
    print("NO")
else:
    print("YES")
Problem p02707 (python)

Fixed submission:
N = int(input())
K = [0]*N
A = [int(i) for i in input().split()]

for i in range(N-1):
    K[A[i]-1] += 1
for i in K:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
for i in range(1,n+1):
    print(a.count[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]
for i in range(1,n+1):
  print(a.count[i])
Problem p02622 (python)

Fixed submission:
S=input()
T=input()
cnt=0
for i in range(len(S)):
  if(S[i]!=T[i]):
    cnt+=1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
cnt=0
for i in len(S):
  if(S[i]==T[i]):
    cnt+=1
    
print(cnt)
Problem p02723 (python)

Fixed submission:
s=input()
if s[2]==s[3] and s[4]==s[5]:print("Yes")
else :print("No")

Buggy submission (verdict: Runtime Error):
from collections import Counter
[N, X, Y] = [int(item) for item in input().split()]
X -= 1
Y -= 1
gyoretu=[]
for i in range(N):
    row=[]
    for j in range(N):
        if i == j:
            row.append(0)
        elif abs(i - j) == 1 or i == X and j == Y or i == Y and j == X:
            row.append(1)
        else:
            row.append(2000)
    gyoretu.append(row)
for k in range(N):
    for i in range(N):
        for j in range(N):
            gyoretu[i][j] = min([gyoretu[i][j], gyoretu[i][k] + gyoretu[k][j]])
array=[]
for i in range(N):
        array+=gyoretu[i][i:]
c=Counter(array)
for i in range(1, N):
    print(c[i])

Buggy submission (verdict: Runtime Error):
s=input()
if s[2]=s[3] and s[4]=s[5]:print("Yes")
else print("No")
Problem p02726 (python)

Fixed submission:
[N, X, Y] = [int(item) for item in input().split()]
X -= 1
Y -= 1
count=[0 for _ in range(N)]
for i in range(N):
    for j in range(i,N):
        count[min(abs(i-j),abs(i-X)+1+abs(Y-j),abs(i-Y)+1+abs(X-j))]+=1
#print(array)


for i in range(1,N):
        print(count[i])

#print(count)

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from collections import Counter
[N, X, Y] = [int(item) for item in input().split()]
X -= 1
Y -= 1
gyoretu=[]
for i in range(N):
    row=[]
    for j in range(N):
        if i == j:
            row.append(0)
        elif abs(i - j) == 1 or i == X and j == Y or i == Y and j == X:
            row.append(1)
        else:
            row.append(2000)
    gyoretu.append(row)
G=csgraph_from_dense(gyoretu)
#print(G)
d=floyd_warshall(G)
#print(d)
#for k in range(N):
#    for i in range(N):
#        for j in range(N):
#            if gyoretu[i][j]> gyoretu[i][k] + gyoretu[k][j]:
#                gyoretu[i][j] =gyoretu[i][k] + gyoretu[k][j]
array=[]
for i in range(N):
        #array += gyoretu[i][i:]
        array += list(d[i][i:])
c=Counter(array)
for i in range(1, N):
    print(c[i])

Buggy submission (verdict: Runtime Error):
from collections import Counter
[N, X, Y] = [int(item) for item in input().split()]
X -= 1
Y -= 1
gyoretu=[]
for i in range(N):
    row=[]
    for j in range(N):
        if i == j:
            row[i][j]=0
        elif abs(i - j) == 1 or i == X and j == Y or i == Y and j == X:
            row[i][j]=1
        else:
            row[i][j] = 2000
    gyoretu.append(row)
for k in range(N):
    for i in range(N):
        for j in range(N):
            if gyoretu[i][j]< gyoretu[i][k] + gyoretu[k][j]:
                gyoretu[i][j] =gyoretu[i][k] + gyoretu[k][j]
array=[]
for i in range(N):
        array+=gyoretu[i][i:]
c=Counter(array)
for i in range(1, N):
    print(c[i])
Problem p02860 (python)

Fixed submission:
N=int(input())
S=input()
len_of_s=len(S)
if len_of_s%2==0 and S[:len_of_s//2]==S[len_of_s//2:]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
len_of_s=len(S)
if len_of_s%2==0 and S[:len_of_s/2]==s[len_of_s/2:]:
  print("Yes")
elif:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
len_of_s=len(S)
if len_of_s%2==0 and S[:len_of_s/2+1]==s[len_of_s/2+1:]:
  print("Yes")
elif
  print("No")
Problem p02572 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
m = (10**9 + 7)

result = 0

sum_a = 0
for i in range(n):
    sum_a = (sum_a + a[i]) % m

result = 0
for i in range(n):
    x = a[i]
    sum_a -= x
    result = (result + x*sum_a) % m

if(result < 0):
    result += m
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
m = (10**9 + 7)
for i in range(n):
    if abs(a[i]-m) < a[i]:
        a[i] = x - m
result = [(a[i]*a[j])%m for i in range(n) for j in range(n) if i < j]
result = sum(result)%m
if(result < 0):
    result += m 
print(result)

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

m = (10**9 + 7)
result = [(a[i]*a[j])%m for i in range(n) for j in range(n) if i < j]
print(sum(result)%m)
Problem p02570 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a<=b*c:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
D,T, S = map(int, input().split())
if T*S>=D:
  print('Yes')
 else:
  print('No')
Problem p02860 (python)

Fixed submission:
N=int(input())
S=str(input())
if N%2==1:
  print('No')
else:
  f=True
  h=int(N/2)
  for i in range(0,h):
    if S[i]!=S[h+i]:
      f=False
  if f==True:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
if N%2==1:
  print('No')
else:
  h_N=int(N/2)
  flg=True
  for i in range(h_N):
    if S[i]!=S[h_N+i]:
      flg=False
  if flg=True:
    print('Yes')
  else:
    print('No')

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

if n % 2 == 1:
    print('No')
else:
    flg=True
    for i in range(int(n/2)):
        if S[i]!=S[int(n/2)+i]:
            flg=False
    if flg==True:
        print('Yes')
    else:
        print('No'):
Problem p02659 (python)

Fixed submission:
from decimal import Decimal

A, B = map(float, input().split())
ans = int(Decimal(str(A))*Decimal(str(B)))
print(ans)

Buggy submission (verdict: Runtime Error):
from decimal import Decimal

A, B = map(float, input().split())
ans = int(A*Decimal(str(B)))
print(ans)
Problem p02829 (python)

Fixed submission:
args = [int(input()) for i in range(2)]
list = [1, 2, 3]
for i in list:
    flg = False
    for j in args:
        if j == i:
            flg = True
    if not flg:
        print(i)

Buggy submission (verdict: Runtime Error):
import sys

def main():
    args = [int(input()) for i in range(2)]
    list = [1, 2, 3]
    for i in list:
        flg = False
        for j in args:
            if j == i:
                flg = True
        if not flg:
            print(i)
            return i

if __name__ == "__main__":
    sys.exit(main())

Buggy submission (verdict: Runtime Error):
import sys

def main():
    args = [int(input()) for i in range(2)]
    list = [1, 2, 3]
    for i in list:
        flg = False
        for j in args:
            if j == i:
                flg = True
        if not flg:
            print(i)
            return i

if __name__ == "__main__":
    sys.exit(main())
Problem p02689 (python)

Fixed submission:
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>h[k]:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(n):
	if len(l[i])==0:
		score+=1
print(score)

Buggy submission (verdict: Runtime Error):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>h[k]:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(m):
	if len(l[i])==0:
		score+=1
print(score)

Buggy submission (verdict: Runtime Error):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>k:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
for i in range(m):
	if len(l[i])==0:
		score+=1
print(score)
Problem p02753 (python)

Fixed submission:
s=list(input())
a=0
for i in range(3):
	if s[i]=='A':
		a+=1
if a==0 or a==3:
	print('No')
else:
	print('Yes')

Buggy submission (verdict: Runtime Error):
s=input().split()
a=0
for i in range(3):
	if s[i]==A:
		a+=1
if a==0 or a==3:
	print('No')
else:
	print('Yes')