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

Fixed submission:
a=int(input())
b=int(input())
if a+b==3:
  print("3")
elif a+b==4:
  print("2")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
a=input().split()
A=int(a[0])
B=int(a[1])
li=[2]
li2=[]
p=0
if B>A:
    c=A
    A=B
    B=A

for i in range(3,int(A**0.5)+1):
    for j in range(2,i+1):
        if j==i:
            li.append(i)
        if i%j==0:
            break
while p==0:
    for s in li:
        if A%s==0 and B%s==0:
            A/=s
            B/=s
            li2.append(s)
            break
        if A%s==0 and B%s!=0:
            A/=s
            li2.append(s)
            break
        if A%s!=0 and B%s==0:
            B/=s
            li2.append(s)
            break
        if s==li[-1]:
            p=1
n=1
for m in li2:
    n*=m
print(n)
Problem p02831 (python)

Fixed submission:
import fractions
a=input().split()
A=int(a[0])
B=int(a[1])
def lcm(x,y):
  return(x*y)//fractions.gcd(x,y)
print(lcm(A,B))

Buggy submission (verdict: Runtime Error):
import math
a=input().split()
A=int(a[0])
B=int(a[1])
print(math.gcd(A,B))
Problem p02836 (python)

Fixed submission:
a=input()
if len(a)%2==0:
    v=int(len(a)/2)
else:
    v=int((len(a)-1)/2)
c=0
for i in range(v):
    if a[i]!=a[-i-1]:
        c+=1
print(c)

Buggy submission (verdict: Runtime Error):
a=input()
if len(a)%2==0:
    v=len(a)/2
else:
    v=(len(a)-1)/2
c=0
for i in range(v):
    if a[i]!=a[-i-1]:
        c+=1
print(c)
Problem p03329 (python)

Fixed submission:
n=int(input())
dp=[float("inf")]*(n+1)
dp[0]=0
for i in range(n):
    for j in range(1,7):
        j=6**j
        if i+j<n+1:
            dp[i+j]=min(dp[i+j],dp[i]+1)
    for j in range(1,6):
        j=9**j
        if i+j<n+1:
            dp[i+j]=min(dp[i+j],dp[i]+1)
    dp[i+1]=min(dp[i+1],dp[i]+1)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
dp=[float("inf")]*n
dp[0]=0
for i in range(n-1):
    for j in range(1,7):
        j=6**j
        if i+j<n:
            cost[i+j]=min(dp[i+j],dp[i]+1)
    for j in range(1,6):
        j=9**j
        if i+j<n:
            cost[i+j]=min(dp[i+j],dp[i]+1)
    dp[i+1]=min(dp[i+1],dp[i]+1)
    

print(dp[-1])
Problem p02712 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 20:58:59 2020

@author: H_Hoshigi
"""

N = int(input())

FizzBuzz_sum_list = [0,1,3,3,7,7,7,14,22,22,22,33,33,46,60]
FizzBuzz_num_list = [0,1,2,2,3,3,3,4,5,5,5,6,6,7,8]

answer = 60*pow(N//15, 2) + FizzBuzz_sum_list[N%15] + 15*(N//15)*FizzBuzz_num_list[N%15]

print(answer)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 20:58:59 2020

@author: H_Hoshigi
"""

N = int(input())

FizzBuzz_sum_list = [0,1,3,3,7,7,7,14,22,22,22,33,33,46]
FizzBuzz_num_list = [0,1,2,2,3,3,3,4,5,5,5,6,6,7,8]

answer = 60*pow(N//15, 2) + FizzBuzz_sum_list[N%15] + 15*(N//15)*FizzBuzz_num_list[N%15]

print(answer)
Problem p02623 (python)

Fixed submission:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A_sum = [0]
for i in range(N):
    A_sum.append(A[i] + A_sum[i])
B_sum = [0]
for i in range(M):
    B_sum.append(B[i] + B_sum[i])    
import bisect
ans = 0
for i in range(N+1):
    a = A_sum[i]
    if K-a >=0:
        b_idx = bisect.bisect(B_sum, K-a) - 1
        if b_idx  < 0:
            b_idx = 0
        ans = max(ans, i+b_idx)
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
time = 0
n = 0
m = 0
for i in range(N+M):
    if n < N and m < M:
        if A[n] <= B[m]:
            time += A[n]
            n += 1
        else:
            time += B[m]
            m += 1
    else:
        if n >= N and m >= M:
            break
        elif n == N -1:
            time += B[m]
            m += 1
        elif m == M -1:
            time += A[n]
            n += 1
    if time < K:
        ans += 1
    else:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
time = 0
n = 0
m = 0
for i in range(N+M):
    if n < N and m < M:
        if A[n] <= B[m]:
            time += A[n]
            n += 1
        else:
            time += B[m]
            m += 1
    else:
        if n == N -1:
            time += B[m]
            m += 1
        elif m == M -1:
            time += A[n]
            n += 1
    if time < K:
        ans += 1
    else:
        break
print(ans)
Problem p02629 (python)

Fixed submission:
N = int(input())
x = 1
alphabet = {i-96:chr(i) for i in range(97, 97+26)}
if int(N) > 26:
    ans = ''
    while x != 0:
        x = N // 26
        mod = N%26
        #print(x, mod)
        if mod == 0:
            ans += 'z'
            #x -= x%26
            x -= 1
        else:
        #print(x, mod, alphabet[mod])
            ans += alphabet[mod]
        N = x
else:
    ans = alphabet[int(N)]
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
x = 1
alphabet = {i-96:chr(i) for i in range(97, 97+26)}
if int(N) > 26:
    ans = ''
    while x != 0:
        x = N // 26
        mod = N%26
        #print(x, mod, alphabet[mod])
        ans += alphabet[mod]
        N = x
else:
    ans = alphabet[int(N)]
print(ans[::-1])
Problem p02689 (python)

Fixed submission:
def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    violate = []
    for _ in range(M):
        A, B = map(int, input().split())
        A -= 1
        B -= 1
        if H[A] == H[B]:
            violate.append(A)
            violate.append(B)
        elif H[A] - H[B] < 0:
            violate.append(A)
        elif H[B] - H[A] < 0:
            violate.append(B)
    violate = list(set(violate))
    num = N - len(violate)
    print(num)
        
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    connect = np.ones((N, N), dtype=int)
    for _ in range(M):
        A, B = map(int, input().split())
        A -= 1
        B -= 1
        connect[A, B] = H[A] - H[B]
        connect[B, A] = H[B] - H[A]
    num = 0
    for i in range(N):
        if len(np.where(connect[i, :] <= 0)[0])  == 0:
            num += 1
    print(num)
        
    
if __name__ == '__main__':
    main()
Problem p02695 (python)

Fixed submission:
import itertools
def main():
    N, M, Q = map(int, input().split())
    abcd = []
    for _ in range(Q):
        a, b, c, d = map(int, input().split())
        abcd.append((a-1, b-1, c, d))
    score = 0
    for ones in list(itertools.combinations([i for i in range(N+M-1)], M-1)):
        temp = [0] * (N + M -1)
        for idx in ones:
            temp[idx] = 1
        A = [0] * N
        idx = 0
        sum_ = 0
        for i in temp:
            if i == 0:
                A[idx] = sum_ + 1
                idx += 1
            else:
                sum_ += 1
        score_temp = get_score(A, abcd)
        if score_temp > score:
            score = score_temp
    print(score)
            
def get_score(A, abcd):
    score = 0
    for a, b, c, d in abcd:
        if A[b] - A[a] == c:
            score += d
    return score

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
mport itertools
def main():
    N, M, Q = map(int, input().split())
    abcd = []
    for _ in range(Q):
        a, b, c, d = map(int, input().split())
        abcd.append((a-1, b-1, c, d))
    score = 0
    for ones in list(itertools.combinations([i for i in range(N+M-1)], M-1)):
        temp = [0] * (N + M -1)
        for idx in ones:
            temp[idx] = 1
        A = [0] * N
        idx = 0
        sum_ = 0
        for i in temp:
            if i == 0:
                A[idx] = sum_ + 1
                idx += 1
            else:
                sum_ += 1
        score_temp = get_score(A, abcd)
        if score_temp > score:
            score = score_temp
    print(score)
            

def get_score(A, abcd):
    score = 0
    for a, b, c, d in abcd:
        if A[b] - A[a] == c:
            score += d
    return score

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

Fixed submission:
import sys
import os
from operator import itemgetter


N,M= map(int, input().split())
A= list(map(int,input().split()))
B=[0]*M
C=[0]*M
for i in range(M):
    B[i], C[i] = map(int, input().split())
A.sort()
#print(A)

D=[list(x) for x in zip(*sorted(zip(C, B), key=itemgetter(0),reverse=True))]
B=D[1]
C=D[0]
k=0
#print(B)
#print(C)
for i in range(M):#C(i) i=1..M
    for j in range(B[i]):#B(i)の個数分C(i)を入れる j=0...Bi
        if k>N-1:
            break
        if A[k]>=C[i]:
            break
        else:
            A[k]=C[i]
            k=k+1
            continue
        break


Asum=sum(A)
#print(A)
print(Asum)

Buggy submission (verdict: Runtime Error):
import sys
import os
from operator import itemgetter


N,M= map(int, input().split())
A= list(map(int,input().split()))
B=[0]*M
C=[0]*M
for i in range(M):
    B[i], C[i] = map(int, input().split())
A.sort()
#print(A)

D=[list(x) for x in zip(*sorted(zip(C, B), key=itemgetter(0),reverse=True))]
B=D[1]
C=D[0]
k=0
#print(B)
#print(C)
for i in range(M):#C(i) i=1..M
    for j in range(B[i]):#B(i)の個数分C(i)を入れる j=0...Bi
        if A[k]>=C[i]:
            break
        else:
            A[k]=C[i]
            k=k+1
            continue
        break


Asum=sum(A)
#print(A)
print(Asum)
Problem p03077 (python)

Fixed submission:
import sys
import os
#import math

N=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())

pmin=min(p)
#g=math.ceil(N/pmin)
g=int(N/pmin)
if (N%pmin)==0:
    print(5+g-1)
else:
    print(5+g)

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

f = open('input.txt', 'r')
sys.stdin = f
N=int(input())
p=[0]*5
for i in range(5):
    p[i]=int(input())

pmin=min(p)
g=math.ceil(N/pmin)
#g=int(N/pmin)
print(5+g-1)
Problem p02880 (python)

Fixed submission:
if __name__ == "__main__":
    a = int(input())
    a = int(a)
    flag=False
    for i in range(1, 10):
        for j in range(1, 10):
            if a == i*j:
                flag=True
                break
        if flag:
            break
            
    if flag==False :
        print('No')
    else :
        print('Yes')

Buggy submission (verdict: Runtime Error):
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__":
    a = int(input())
    a = int(a)
    b = prime_factorize(a)
    c = len(b)
    if c==1:
        if b[0]<=9 and b[0]>=1:
            print('yes')
        else :
            print('no')
    elif c==2:
        if b[0]<=9 and b[0]>=1 and b[1]<=9 and b[1]>=1:
            print('yes')
        else :
            print('no')
    else :
        while len(b) > 2:
            b1 = b.pop(0)
            b2 = b.pop(0)
            b.append(b1*b2)
        if b[0]<=9 and b[0]>=1 and b[1]<=9 and b[1]>=1:
            print('yes')
        else :
            print('no')

Buggy submission (verdict: Runtime Error):
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__":
    a = int(input())
    a = int(a)
    b = prime_factorize(a)
    print(b)
    c = len(b)
    if c==1:
        if b[0]<=9 and b[0]>=1:
            print('yes')
        else :
            print('no')
    elif c==2:
        if b[0]<=9 and b[0]>=1 and b[1]<=9 and b[1]>=1:
            print('yes')
        else :
            print('no')
    else :
        while len(b) > 2:
            b1 = b.pop(0)
            b2 = b.pop(0)
            b.append(b1*b2)
        print(b)
        if b[0]<=9 and b[0]>=1 and b[1]<=9 and b[1]>=1:
            print('yes')
        else :
            print('no')
Problem p02594 (python)

Fixed submission:
n=int(input())

print('Yes' if n>=30 else "No")

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


con=False

ans=0
for i in range(3):
  if(s[i]=="R" and con):
    ans+=1
  elif(s[i]=="R" and not(con)):
    ans=1
    con=True
  else:
    con=False
      
print(ans)

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

rcount=s.count("R")
num=s[0:rcount]
rnum=num.count("R")



print(rcount-rnum)
Problem p02596 (python)

Fixed submission:
k = int(input())

go = 0
keta = len(str(k))

for i  in range(10**1000000):
    if k % 2 ==0:
        print(-1)
        break
    if k % 5==0:
        print(-1)
        break
    else:
        go =(go*10+7) %k
        if go ==0:
            print(i+1)
            break

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

pn=factorization(k)

go =0
keta = len(str(k))
sevens = []

if k % 2 == 0 or k %5 == 0:
    print(-1)
    break
elif str(k)[-1] == "3":
    for i in range(9,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i)):
            continue
        else:
            print(str(k * i).count('7'))
elif str(k)[-1] == "7":
    for i in range(1,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i)):
            continue
        else:
            print(str(k * i).count('7'))
elif str(k)[-1] == "9":
    for i in range(3,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i)):
            continue
        else:
            print(str(k * i).count('7'))
elif str(k)[-1] == "1":
    for i in range(7,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i)):
            continue
        else:
            print(str(k * i).count('7'))

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

pn=factorization(k)

go =0
keta = len(str(k))
sevens = []

if k % 2 == 0 or k %5 == 0:
    print(-1)
    break
elif str(k)[-1] == "3":
    for i in range(9,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i))
            continue
        else:
            print(str(k * i).count('7'))
elif str(k)[-1] == "7":
    for i in range(1,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i))
            continue
        else:
            print(str(k * i).count('7'))
elif str(k)[-1] == "9":
    for i in range(3,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i))
            continue
        else:
            print(str(k * i).count('7'))
elif str(k)[-1] == "1":
    for i in range(7,10**100000,10):
        if not str(k * i).count('7') == len(str(k*i))
            continue
        else:
            print(str(k * i).count('7'))
Problem p02629 (python)

Fixed submission:
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = ''
    for i in range(1, 99):
	    if N <= 26 ** i:
		    N -= 1
		    for j in range(i):
			    ans += chr(ord('a') + N % 26)
			    N //= 26
			break
	else:
		N -= 26 ** i
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / 26 <1:
        p = [chr(n + 96)]
        break
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))
    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))

    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))
Problem p02659 (python)

Fixed submission:
import math
from decimal import Decimal
n=input().split()
a = int(n[0])
b=Decimal(n[1])
ans = a*b

print(int(ans))

Buggy submission (verdict: Runtime Error):
import math
n=input().split()
a = int(n[0])
b=int(n[1]) *100

ans = a*b

print(ans/100)

Buggy submission (verdict: Runtime Error):
import math
n=input().split()
a = int(n[0])*100
b=int(n[1]) *100

ans = a*b

print(ans/100)
Problem p02726 (python)

Fixed submission:

N, X, Y = input().split()
N = int(N)
X = int(X)
x = X - 1
Y = int(Y)
y = Y -1
ans = [0] * (N)
A = [[] * N for _ in range(N)]
for i in range(N):
    for j in range(N-i):
        path = min(abs(x- i) +1 +abs(y-i-j),j)
        ans[path] += 1
for _ in range(len(ans)):
    if _ == 0:
        continue
    print(ans[_])

Buggy submission (verdict: Runtime Error):
N, X, Y = input().split()
N = int(N)
X = int(X)
x = X - 1
Y = int(Y)
y = Y -1
ans = []
A = [[0] * N for _ in range(N)]
for i in range(N):
    for j in range(N-i):
        path = min(abs(x- i) +1 +abs(y-i-j),j)
        ans[path] += 1
print(*ans, sep="\n")
Problem p02729 (python)

Fixed submission:
S = input().split()
N = int(S[0])
M = int(S[1])

print(int(N * (N-1)/2 + M * (M-1)/2))

Buggy submission (verdict: Runtime Error):
import numpy
import copy
N = int(input())
E= list(map(int,input().split()))
ans = [0 for _ in range(N)]
unique = numpy.unique(E)
#for s in range(len(unique)):
#unique = int(unique)
uniqueNum = [0 for _ in range(len(unique))]

uniqueAns = [0 for _ in range(len(unique))]

y =0
for t in range(len(unique)):
    uniqueNum[t] = E.count(unique[t])
for g in range(len(unique)):
    uni = copy.copy(uniqueNum)
    uni[g] = uni[g] -1
    for h in range(len(unique)):
        y = y + uni[h] * (uni[h]-1)/2
    uniqueAns[g] =  y
for k in range(N):
    for w in range(len(uni)):
        if unique[w] == E[k]:
            ans[k] = uniqueAns[w]
            break
for i in range(N):
    print(int(ans[i]))
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
k,n=input().split();
a=input().split();
k=int(k);
n=int(n);
by=0;
for i in range(n):
	a[i]=int(a[i]);
for i in range(n-1):
	if a[i+1]-a[i]>by:
		by=a[i+1]-a[i];
if (k-a[n-1])+a[0]>by :
	by=(k-a[n-1])+a[0];
print(k-by);
Problem p02829 (python)

Fixed submission:
a=input()
b=input()
print(6-int(a)-int(b))

Buggy submission (verdict: Runtime Error):
import fractions
a,b=input().split()
a=int(a)
b=int(b)
lcm=a*b/fractions.gcd(a,b)
print(int(lcm))
Problem p02847 (python)

Fixed submission:
days=['SUN','MON','TUE','WED','THU','FRI','SAT']
in_day=input()
inx=days.index(in_day)
out_day=7-inx
print(out_day)

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

for i in s:
    print(chr((ord(i)-65+n)%26+65),end="")

Buggy submission (verdict: Runtime Error):
days=['SUN','MON','TUE','WED','THU','FRI','SAT']
in_day=input()
inx=days.index(in_day)
out_day=7-inx
print(days[out_day])
Problem p02879 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
if 0<a<10 and 0<b<10:
  print(a*b)
else:
  print('-1')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
if 0<a<10 and 0<b<10:
  print(a*b)
else:
  print('-1')
Problem p02580 (python)

Fixed submission:

H, W, M = list(map(int, input().split()))

h = [0] * H
w = [0] * W

hw = {}

for _ in range(M):
    a, b = list(map(int, input().split()))
    h[a - 1] += 1
    w[b - 1] += 1
    temp = "x" + str(a - 1) + "y" + str(b - 1)
    hw[temp] = 1

hm = max(h)
wm = max(w)

hp = [i for i, v in enumerate(h) if v == hm]
wp = [i for i, v in enumerate(w) if v == wm]

for x in hp:
    for y in wp:
        temp = "x" + str(x) + "y" + str(y)
        if temp not in hw:
            print(hm + wm)
            exit()
else:
    print(hm + wm - 1)

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

h = [0] * H
w = [0] * W

hw = []

for _ in range(H):
    hw.append([0] * W)

for _ in range(M):
    a,b = list(map(int,input().split()))
    h[a - 1] += 1
    w[b - 1] += 1
    hw[a - 1][b - 1] += 1
    
hm = max(h)
wm = max(w)

hp = [i for i, v in enumerate(h) if v == hm]
wp = [i for i, v in enumerate(w) if v == wm]

for x in hp:
    for y in wp:
        if hw[x][y] == 0:
            print(hm + wm)
            exit()
else:
    print(hm + wm - 1)
Problem p02819 (python)

Fixed submission:
# coding cell (SUBMIT ONLY THIS CELL)

import math

X = int(input())
temp = False

if X == 2:
    print(2)
    exit()

if X % 2 == 0:
    X += 1

while temp == False:

    for i in range(int(math.sqrt(X) // 2)):
        if X % (2 * (i + 1) + 1) != 0:
            temp = True
        else:
            temp = False
            break

    X += 2        
    
print(X - 2)

Buggy submission (verdict: Runtime Error):

import math

input1 = int(input())

if input1 == 2:
    print(2)

else:

    for b in range(100000):
        result = 0
        X = input1 + b
        for a in range(int(math.sqrt(X))):
            if X % (a + 2) == 0:
                result += 1
                break
            else:
                result += 0
        if result == 0:
            break

print(X)

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

from sympy import nextprime
print(nextprime(input1))
Problem p02835 (python)

Fixed submission:
input1 = input()
A1 = int(input1.split()[0])
A2 = int(input1.split()[1])
A3 = int(input1.split()[2])

if A1+A2+A3 > 21:
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
input1 = input()
A1 = int(input1.split([0]))
A2 = int(input1.split([1]))
A3 = int(input1.split([2]))

if A1+A2+A3 > 21:
    print("bust")
else:
    print("win")
Problem p02831 (python)

Fixed submission:
import fractions


A, B = map(int, input().split())
lcm = A * B / fractions.gcd(A, B)
print(int(lcm))

Buggy submission (verdict: Runtime Error):
import math


A, B = map(int, input().split())
lcm = A * B / math.gcd(A, B)
print(int(lcm))
Problem p02659 (python)

Fixed submission:
import math
import bisect
#[int(x) for x in input().split()]
#map(int,input().split())
#for _ in range(int(input())):
a,b=input().split()
a=int(a)
b=list(b.split("."))
b=''.join(b)
b=int(b)

print(a*b//100)

Buggy submission (verdict: Runtime Error):
import math
import bisect
#[int(x) for x in input().split()]
#map(int,input().split())
#for _ in range(int(input())):
a,b=input().split()
a=int(a)
b=b.split('.')
b=int(b)

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