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

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sm=0
mod=10**9+7
s=sum(A)
for i in A:
    s-=i
    sm+=i*s
    sm%=mod
print(sm)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
sm=0
mod=10**9+7
s=sum(A)
for i in range(A):
    s-=i
    sm+=i*s
    sm%=mod
print(sm)
Problem p03745 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
i=0
cnt=0

tmp=[]
for i in range(1,n):
    if a[i]>a[i-1]:
        tmp.append(1)
    elif a[i]==a[i-1]:
        tmp.append(0)
    else:
        tmp.append(-1)

flg=0
swi=0
for j in range(len(tmp)):
    if swi==1:
        flg=tmp[j]
        swi=0
        continue
 
    if flg==0:
        flg=tmp[j]
    elif flg==1:
        if tmp[j]==-1:
            cnt+=1
            flg=-1
            swi=1
    elif flg==-1:
        if tmp[j]==1:
            cnt+=1
            flg=1
            swi=1

print(cnt+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B=[2]*(N)
if n<=2:
    print(1)
    exit(0)
 
for i in range(N-1):
    if A[i]>A[i+1]:
        B[i]=-1
    elif A[i]==A[i+1]:
        B[i]=0
    elif A[i]<A[i+1]:
        B[i]=1
i=0
cnt=[0]*N
while True:
    if B[i]==1:
        if B[i+1]==0 or B[i+1]==1:
            i+=1
        elif B[i+1]==-1:
            if cnt[i-1]==0 or i==0:
                cnt[i]=1
            i+=1
        else:
            i+=1
    if B[i]==0:
        i+=1
    if B[i]==-1:
        if B[i+1]==0 or B[i+1]==-1:
            i+=1
        elif B[i+1]==1:
            if cnt[i-1]==0 or i==0:
                cnt[i]=1
            i+=1
        else:
            i+=1
    if B[i]==2:
        break
print(cnt.count(1)+1)
Problem p03785 (python)

Fixed submission:
N,C,K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
ans=s=0
while s<N:
    t=T[s]+K
    sm=1
    for i in range(s+1,min(s+C,N)):
        if T[i]<=t:
            sm+=1
        else:
            break
    s+=sm
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N,C,K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
ans=s=0
while s<N:
    t=T[s]+K
    sm=1
    for i in range(s+1,s+c):
        if T[i]<t:
            sm+=1
        else:
            break
    s+=sm
    ans+=1
print(ans)
Problem p03805 (python)

Fixed submission:
import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,N):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools
N, M = map(int, input().split())
p=[[0]*N for i in range(N)]
for i in range(M):
    a,b=map(int,input().split())
    p[a-1][b-1]=1
    p[b-1][a-1]=1
cnt=0
a=[i for i in range(N)]

for i in itertools.permutations(a):
    flag=0
    if i[0]==0:
        for j in range(1,M):
            if p[i[j]][i[j-1]]!=1:
                flag=1
        if flag==0:
            cnt+=1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
cnt=0
for l in range(1,N+1):
    for i in itertools.combinations(A,l):
        a=[0]*N
        for j,k in i:
            a[j-1]+=1
            a[k-1]+=1
        if a[0]==1 and a.count(1)==2 and a.count(2)==N-2:
            cnt+=1
print(cnt)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
 
A,B = input().split()
 
A=int(A)
B=Decimal(B)
print(int(A*B))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
 
A,B = input().split()
 
A=int(A)
B=Decimal(B)
print(int(a*b))
Problem p02629 (python)

Fixed submission:
import sys
import itertools
#import resource
#xrange = lambda stop: iter(itertools.count().next, stop)
#sys.setrecursionlimit(1000000)
#sys.setrecursionlimit(10 ** 13)
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    sys.exit()


ans = []
while True:
    n -= 1
    ans.append(chr(ord("a") + n % 26))
    n //= 26
    if n <= 0:
        break
for i in range(len(ans)):
    print(ans[-i-1], end="")

Buggy submission (verdict: Runtime Error):
import sys
import itertools
import resource
xrange = lambda stop: iter(itertools.count().next, stop)
sys.setrecursionlimit(1000000)
ys.setrecursionlimit(10 ** 9)
resource.setrlimit(resource.RLIMIT_STACK, (-1, -1))
n = int(input())

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    sys.exit()



def Base_10_to_26(X):
    if (X//26):
        return Base_10_to_26(int(X//26))+chars[int(X%26)]
    return chars[int(X%n)]

print(Base_10_to_26(n))

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

chars ={1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}

if n <= 26:
    print(chars[n])
    exit()



def Base_10_to_26(X):
    if (int(X/26)):
        return Base_10_to_26(int(X/26))+chars[int(X%26)]
    return chars[int(X%n)]

N = (Base_10_to_26(n))

print(N)
Problem p02699 (python)

Fixed submission:
a, b = map(int, input().split())
if a <= b:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a <= b:
    print("unsafe")
else:
    print("safe")
Problem p02729 (python)

Fixed submission:
import math
import sys
n, m = map(int, input().split())

def combinations_count(n, r):
    C = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    return C

if n <= 1 and m >= 2:
    print(combinations_count(m, 2))
    sys.exit()
elif n >= 2 and m <= 1:
    print(combinations_count(n, 2))
    sys.exit()
elif n == m == 1:
    print(0)
    sys.exit()
elif n == m == 0:
    print(0)
    sys.exit()
else:
    print(combinations_count(n, 2) + combinations_count(m, 2))

Buggy submission (verdict: Runtime Error):
import math
import sys
n, m = map(int, input().split())

def combinations_count(n, r):
    C = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    return C

if n <= 1 and m >= 2:
    print(combinations_count(m, 2))
    sys.exit()
elif n >= 2 and m <= 1@:
    print(combinations_count(n, 2))
    sys.exit()
elif n == m == 1:
    print(1)
    sys.exit()
elif n == m == 0:
    print(0)
    sys.exit()
else:
    print(combinations_count(n, 2) + combinations_count(m, 2))

Buggy submission (verdict: Runtime Error):
import math
import sys
n, m = map(int, input().split())

def combinations_count(n, r):
    C = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    return C

if n == 0 and m >= 2:
    print(combinations_count(m, 2))
    sys.exit()
elif n >= 2 and m == 0:
    print(combinations_count(n, 2))
    sys.exit()
elif n == m == 1:
    print(1)
    sys.exit()
elif n == m == 0:
    print(0)
    sys.exit()
else:
    print(combinations_count(n, 2) + combinations_count(m, 2))

Buggy submission (verdict: Runtime Error):
import math
import sys
n, m = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if n == 0 and m <= 2:
    print(combinations_count(m, 2))
    sys.exit()
elif n <= 2 and m == 0:
    print(combinations_count(n, 2))
    sys.exit()
elif n == m == 1:
    print(1)
    sys.exit()
else:
    print(combinations_count(n, 2) + combinations_count(m, 2))

Buggy submission (verdict: Runtime Error):
import math
import sys
n, m = map(int, input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(n, 2) + combinations_count(m, 2))
Problem p02777 (python)

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

if s == u:
    print(a-1, b)
else:
    print(a, b-1)

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

if s == u:
    print(a-1,end="")
    print(b)
else:
    print(a,end="")
    print(b-1)

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

if s == u:
    print(a-1, b, end="")
else:
    print(a, b-1, end="")
Problem p02831 (python)

Fixed submission:
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):
import math
a,b=map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(a,b))
Problem p02836 (python)

Fixed submission:
s = input()
cnt = 0
for i in range(len(s)//2):
    if s[i] != s[-i -1]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import sys
import math

s = input()
l = len(s) //2

if is_kaibun(s):
    print(0)
    sys.exit()

def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

def kisu(s):    
    ans_k = 0
    l = len(s) //2
    for i in range(l +1, len(s)):
        if s[i] != s[l -i]:
            s.replace(s[i], s[l -i])
            ans_k += 1
        if is_kaibun(s):
            return ans_k
    return l -1

def gusu(s):
    ans_g = 0
    l = len(s) //2
    for i in range(l):
        if s[i] != s[l]:
            s.replace(s[i], s[l +i])
            ans_g += 1
        if is_kaibun(s):
            return ans_g
    return l
if len(s) % 2 == 0:
    print(gusu(s))
else:
    print(kisu(s))
Problem p02897 (python)

Fixed submission:
n = int(input())

if n % 2 == 1:
    a = n // 2 + 1
else:
    a = n // 2
print(a / n)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans = []
for i in range(n):
    ans.append(0)
for i in range(n):
    ans[a[i]-1] = i +1
for i in range(len(ans)):
    print(ans[i], end=" ")
Problem p02970 (python)

Fixed submission:
import math
n, d = map(int, input().split())
print(math.ceil(n / (2*d +1)))

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())
print(math.ceil(n / (2*d +1)))
Problem p03041 (python)

Fixed submission:
n, k = map(int, input().split())
s = input()
for i in range(0, k-1):
    print(s[i], end="")
print(str.swapcase(s[k-1]), end="")
for i in range(k, n):
    print(s[i], end="")

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = list(input())
s[k].lower()
for i in range(n):
  print(s[k], end="")
Problem p03242 (python)

Fixed submission:
n = list(input())

for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"

for j in range(3):
  print(n[j], end="")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
print("".join(n))

Buggy submission (verdict: Runtime Error):
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
print("".join(n))

Buggy submission (verdict: Runtime Error):
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
for i in n:
    print(i, end = "")

Buggy submission (verdict: Runtime Error):
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
for i in 3:
    print(i, end = "")

Buggy submission (verdict: Runtime Error):
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
for j in 3:
    print(j, end = "")

Buggy submission (verdict: Runtime Error):
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
for j in 3:
    print(n[j], end = "")

Buggy submission (verdict: Runtime Error):
n =int(input)
lst = []
while n > 0:
    lst.append(n% 10)
    n //= 10
lst.reverse()
for i in 3:
    if lst[i] == "1":
        lst[i] == "9"
    elif lst[i] == "9":
        lst[i] == "1" 
print(lst)

Buggy submission (verdict: Runtime Error):
n=int(input())
out = n.replace("1","a")
out = n.replace("9","1")
out = n.replace("a","9")
print(out)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(n.replace("1","a"))
print(n.replace("9","1"))
print(n.replace("a","9"))
Problem p02547 (python)

Fixed submission:
def main():
    import sys
    ikimasu = sys.stdin.buffer.readline
    ini = lambda: int(ins())
    ina = lambda: list(map(int, ikimasu().split()))
    ins = lambda: ikimasu().strip()
    
    n= ini()
    tmp = 0
    for _ in range(n):
        l,r = ina()
        if(l==r):
            tmp+=1
            if(tmp==3):
                print("Yes")
                return
        else:
            tmp =0
    print("No")
        


        


    




















if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys
    in = sys.stdin.buffer.readline
    ini = lambda: int(ns())
    ina = lambda: list(map(int, in().split()))
    ins = lambda: in().strip()
    
    n= ini()
    tmp = 0
    for _ in range(n):
        l,r = ina()
        if(l==r):
            tmp+=1
            if(tmp==3):
                print("Yes")
                return
        else:
            tmp =0
        


        


    




















if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    import sys
    inl = sys.stdin.buffer.readline
    
    n= int(input())
    tmp = 0
    for _ in range(n):
        l,r = map(int,inl().split())
        if(l==r):
            tmp+=1
            if(tmp==3):
                print("Yes")
                return
        else:
            tmp =0
        


        


    




















if __name__ == "__main__":
    main()
Problem p02577 (python)

Fixed submission:
N = str(input())
lists = [int(x) for x in N]
a = sum(lists)

if  a % 9 == 0:
        print('Yes')
else:
        print('No')

Buggy submission (verdict: Runtime Error):
N = str(input())
lists = [int(x) for x in N]

if a % 9 == 0:
        print('Yes')
else:
        print('No')
Problem p02578 (python)

Fixed submission:
N = int(input())
lists = [int(x) for x in input().split()]
step_sum = 0

for y in range(1, N):
    if lists[y - 1] <=  lists[y]:
        continue
    else:
        s = abs(lists[y] - lists[y -1])
        lists[y] += s
        step_sum += s
        continue
        
print(step_sum)

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

high_sum = 0

for x in range(int(N)):
    if x < int(N ) - 1:
        if lists[x] < lists[x + 1]:
            a = lists[x + 1] - lists[x]
            high_sum += a
        else:
            continue
    else:
        b = lists[x] - lists[x - 1]
        if b < 0:
            high_sum += a
        else:
            continue
        
print(high_sum)

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

high_sum = 0

for x in range(int(N)):
    if x < int(N ) - 1:
        if lists[x] < lists[x + 1]:
            a = lists[x + 1] - lists[x]
            high_sum += a
        else:
            continue
    else:
        b = lists[x] - lists[x - 1]
        if b < 0:
            high_sum += a
        else:
            break
        
print(high_sum)
Problem p02793 (python)

Fixed submission:
import time, math
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

def f(a):
    M=10**9+7
    ans, z = 0, 1
    for x in a:
        z = (z * x) // gcd(z, x)
    #print(z)
    z %= M
    for x in a:
        ans += z * pow(x, M-2, M)
        ans %= M
    return ans

n = input()
a = list(map(int, input().split()))
#a = []
#for i in range(1000):
#    a.append(1000000-i)
print(f(a))

Buggy submission (verdict: Runtime Error):
import time, math

def f(a):
    M=10**9+7
    ans, z = 0, 1
    for x in a:
        z = (z * x) // math.gcd(z, x)
    #print(z)
    z %= M
    for x in a:
        ans += z * pow(x, M-2, M)
        ans %= M
    return ans

n = input()
a = list(map(int, input().split()))
#a = []
#for i in range(1000):
#    a.append(1000000-i)
print(f(a))
Problem p02879 (python)

Fixed submission:
a,b = map(int,input().split())
ans = a*b
if a>9 or b>9:
  ans = -1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input())
ans = a*b
if a>9 or b>9:
  ans = -1
print(ans)
Problem p02627 (python)

Fixed submission:
print("Aa"[ord(input())>95])

Buggy submission (verdict: Runtime Error):
print("Aa"[int(ord(input())>95))

Buggy submission (verdict: Runtime Error):
print("Aa"[ord(input())>95)

Buggy submission (verdict: Runtime Error):
print("Aa"[ord(input()[0])>95)

Buggy submission (verdict: Runtime Error):
print("Aa"[ord(open(0))>95])
Problem p02550 (python)

Fixed submission:
n,x,m=map(int,input().split())
i=int(2)
a=[x]
q=int(0)
while (i <= n) and (q == 0):
	x=(x**2)%m
	if x in a:
		q=1
	else:
		a.append(x)
	i=i+1

if len(a) == n:
	print(sum(a))	
else:
	j=a.index(x)
	b=a[0:j]
	c=a[j:]
	lb=len(b)
	lc=len(c)
	k=(n-lb)%lc
	l=(n-lb)//lc
	d=c[0:k]
	print(sum(b)+sum(c)*l+sum(d))

Buggy submission (verdict: Runtime Error):
n,x,m=map(int,input().split())
i=int(2)
a=[x]
while (i <= n):
	x=(x**2)%m
	if x in a:
		goto .abc
	else:
		a.append(x)
label .abc
if len(a) == n:
	print(sum(a))	
else:
	j=a.index(x)
	b=a[0:j]
	c=a[j:]
	lb=len(b)
	lc=len(c)
	k=(n-lb)%lc
	l=(n-lb)//lc
	d=c[0:k]
	print(sum(b)+sum(c)*l+sum(d))
Problem p02873 (python)

Fixed submission:
s=str(input())
n=len(s)
i=0
ans=0
c=0
d=0
j=0
while i < n:
	if s[i] == "<":
		c=c+1
		ans=ans+c
		j=0
	else:
		j=j+1
		if j > 1:
			if d >= j:
				ans=ans+j-1
			else:
				ans=ans+j
		elif i == 0:
			ans=1
		else:
			d=c
		c=0
	i=i+1
print(ans)

Buggy submission (verdict: Runtime Error):
s=str(input())
n=len(s)
i=0
ans=0
c=0
while i < n:
	if s[i] == "<":
		c=c+1
		ans=ans+c
	else:
		j=1
		while (i >= j) and (s[i-j] == ">"):
			j=j+1
		if j > 1:
			if d >= j:
				ans=ans+j-1
			else:
				ans=ans+j
		elif i == 0:
			ans=1
		else:
			d=c
		c=0
	i=i+1
print(ans)
Problem p02880 (python)

Fixed submission:
n=int(input())
i=1
while i < 10:
  if n%i==0:
    if n/i < 10:
      print("Yes")
      i=10
  i=i+1
if i == 10:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
i=1
while i < 10:
  if n%i==0:
    if n/i < 10:
      print(Yes)
      i=10
  i=i+1
if i=10:
  print(No)
Problem p02572 (python)

Fixed submission:
def main():
    N = int(input())
    A_list = list(map(int, input().split()))
    mod = 10**9 + 7

    ans = 0
    A_ = sum(A_list) % mod
    for i in range(N-1):
        A = A_list[i]
        A_ = A_ - A
        ans = (ans + (A * A_) % mod) % mod
    print(ans)
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    A_list = list(map(int, input().split()))
    mod = 10**9 + 7

    ans = 0
    A_ = sum(A_list) % mod
    for i in range(N-1):
        A = A_list[i]
        A_ = A_ - A
        ans = (ans + (A * A_) % mod)) % mod
    print(ans)
    return


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    A_list = list(map(int, input().split()))
    mod = 10**9 + 7

    ans = 0
    A_ = sum(A_list) % mod
    for i in range(N):
        A = A_list[i]
        A_ = A_ - A
        ans = (ans + (A * A_) % mod)) % mod
    print(ans)
    return


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

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

A = int(A)
B = int(float(B) * 100 + 0.5)
ans = A * B // 100

print(ans)

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

A = int(A)
B = float(B)

print(int((A * (B * 100)) / 100))

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

print((A * (B * 100)) / 100)

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

print(A * (B * 100) / 100)

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

print(int(A*B))

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

print(int(A*B))

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

print(A*B*10//10)
Problem p02879 (python)

Fixed submission:
A, B = map(int,input().split())
ans = A*B if (1 <= A <= 9) and (1 <= B <= 9) else -1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
root = int(N**0.5)
print(min([i + N //i -2 for i in range(1, root+1) if N % i == 0]))

Buggy submission (verdict: Runtime Error):
N = int(input())
root = int(N**0.5)
print(min([i + N //i -2 for i in range(1, root+1) if N % i == 0])
Problem p02881 (python)

Fixed submission:
N = int(input())
root = int(N**0.5)

pairs = [[i, N //i] for i in range(1, root+1) if N % i == 0]

move = min([pair[0] + pair[1] -2 for pair in pairs])
print(move)

Buggy submission (verdict: Runtime Error):
root = int(int(input())**0.5)
print(min([i + N //i -2 for i in range(1, root+1) if N % i == 0])
Problem p02766 (python)

Fixed submission:
import math
N,K = map(int,input().split())
Ans = (int(math.log(N,K)) +1)
print(Ans)

Buggy submission (verdict: Runtime Error):
import math
N,K = map(int,input().split())
Ans = (math.log(K,N) +1)
print(Ans)
Problem p02819 (python)

Fixed submission:
x = int(input())
if x <= 3:
  n = x
elif x == 4:
  n = 5
else:
  n = x
  j = 0
  while j == 0:
    a = int(n/2) + 1
    i = 2
    while i < a:
      if i == a-1:
        j = 1
        i = a
      elif n % i != 0:
        i += 1
      else:
        i = a
        n += 1
print(n)

Buggy submission (verdict: Runtime Error):
import math
n = input()
i = 11

if n == 8 or n ==9:
  print(11)
  i = 0
elif n == 2 or n== 3 or n == 5 or n == 7:
  print(n)
  i = 0
elif n <= 7 and n%2 == 0:
  print(n+1)
  i = 0

while i != 0:
  j = 3
  js = int(math.sqrt(i))
  while j <= js:
    if  i%j == 0:
      break
    elif j == js or j == js-1:
      print(i)
      break
      i = 0
    else:
      if j%2 == 0:
        j += 1
      else:
        j += 2
  if i%2 == 0:
    i += 1
  else:
    i += 2
Problem p02859 (python)

Fixed submission:
r = int(input())
A = r**2
print(A)

Buggy submission (verdict: Runtime Error):
a = map(int,input())
print(a**2)
Problem p02627 (python)

Fixed submission:
s=input()
if s in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
import numpy as np
k=int(input())
s=input()
ls=len(s)
r1=26**ls
a=np.array([range(k+1,k+ls+1)])
m2= np.prod(a)
a=np.array([range(1,ls+1)])
m3= np.prod(a)
m=m2//m3
#r2=25**ls
r3=26**k
#print(r2)
#print(m2)
print((m*r3)%1000000007)
Problem p02659 (python)

Fixed submission:
a,b=map(int,input().replace(".","").split())
t=(a*b)//100
t=int(t)
print(t)

Buggy submission (verdict: Runtime Error):
s=input().replace(" ","*").replace(".","")
t=eval(s)
t=int(t//100)
print(t)
Problem p02682 (python)

Fixed submission:
a,b,c,k=map(int,input().split())
print(min((a-max(k-a-b,0)),k))

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
print(min((a-max(k-a-b,0)),k)

Buggy submission (verdict: Runtime Error):
a,b,c,k=map(int,input().split())
printmin((a-max(k-a-b,0)),k)
Problem p02712 (python)

Fixed submission:
i=int(input())
i1=i*(i+1)//2
i2=i//3
i3=i//5
i4=i2*(i2+1)//2
i5=i3*(i3+1)//2
i6=i//15
i7=i6*(i6+1)//2
print(i1-i4*3-i5*5+i7*15)

Buggy submission (verdict: Runtime Error):
    i=int(input())
    i1=i*(i+1)/2
    i2=i//3
    i3=i//5
    i4=i2*(i2+1)/2
    i5=i3*(i3+1)/2
    i6=i//15
    i7=i6*(i6+1)/2
    print(i1-i4-i5+i6)