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

Fixed submission:
char = input()
if char == "Sunny":
    print("Cloudy")
elif char == "Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
char = input()
if char == Sunny:
    print(Cloudy)
elif char == Cloudy:
    print(Rainy)
else:
    print(Sunny)
Problem p02922 (python)

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

cnt = 0
hole = a
if b==1:
    cnt = 0

elif b!=1 and a>=b:
    cnt = 1
else:
    for i in range(pow(2,10)):
            hole +=(a-1)
            
            if b<=hole:
                cnt = i+2
                break
            else:
                pass
print(cnt)

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

cnt = 0

if b<=a:
    cnt = 1
hole = a
else:
    for i in range(15):
            hole +=(a-1)
            
            if b<=hole:
                cnt = i+2
                break
            else:
                pass
print(cnt)

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

cnt = 0
hole = a
if b<=a:
    cnt = 1
elif:
    for i in range(b):
            hole +=(a-1)
            
            if b<=hole:
                cnt = i+2
            else:
                pass
print(cnt)

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

cnt = 0
hole = a
if b<=a:
    cnt = 1
elif:
    for i in range(b/a + 10):
            hole +=(a-1)
            
            if b<=hole:
                cnt = i+2
            else:
                pass
print(cnt)
Problem p02945 (python)

Fixed submission:
x,y = map(int,input().split())

ans = [x*y,x+y,x-y]

print(max(ans))

Buggy submission (verdict: Runtime Error):
num = int(input())
char=[] #appendのために宣言が必要
while True:
    try:
        char.append(list(input()))

    except:
        break
new_char=[]
cnt=0
for i in range(num):
	new_char.append(sorted(char[i]))
for x in range(num):
    for y in range(num):
        if new_char[x]==new_char[y] and x!=y:
            cnt = cnt+1
print(cnt//2)

Buggy submission (verdict: Runtime Error):
num = int(input())
char=[] #appendのために宣言が必要
while True:
    try:
        char.append(list(input()))

    except:
        break
new_char=[]
cnt=0
for i in range(num):
	new_char.append(sorted(char[i]))
for x in range(num):
    for y in range(num):
        if new_char[x]==new_char[y] and x!=y:
            cnt = cnt+1
print(cnt)
Problem p03455 (python)

Fixed submission:
x,y = map(int,input().split())

if (x*y) % 2 == 0:
    print("Even")

else:
    print("Odd")

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

if (a*b) % 2 == 0:
    print("Even")

else:
    print("Odd")

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

if (a*b) % 2 == 0:
    print("Even")

else:
    print("Odd")
Problem p03493 (python)

Fixed submission:
num = list(input())


print(num.count("1"))

Buggy submission (verdict: Runtime Error):
x,y,z= map(int,input().split())

print("x+y+z")
Problem p02882 (python)

Fixed submission:
import math
a,b,x=map(int,input().split())
if x==a*a*b:
  ans=0
elif x<=a*a*b/2:
  ans=90-math.degrees(math.atan(2*x/a/b/b))
else:
  ans=90-math.degrees(math.atan(a*a*a/2/(a*a*b-x)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if x<=a*a*b/2:
  ans=90-math.degrees(math.atan(2*x/a/b/b))
else:
  ans=90-math.degrees(math.atan(a*a*a/2/(a*a*b-x)))
print(ans)
Problem p02662 (python)

Fixed submission:
import sys
import bisect
import math
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from operator import itemgetter

n,s=map(int,readline().split())
a=list(map(int,readline().split()))
mod=998244353
dp=[[0 for j in range(s+1)] for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(s+1):
        dp[i+1][j]+=2*dp[i][j]
        dp[i+1][j]%=mod
        if j+a[i]<=s:
            dp[i+1][j+a[i]]+=dp[i][j]
            dp[i+1][j+a[i]]%=mod
print(dp[n][s])

Buggy submission (verdict: Runtime Error):
import sys
import bisect
import math
import numpy as np
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from operator import itemgetter

n,s=map(int,readline().split())
a=list(map(int,readline().split()))
mod=998244353
dp=[[0 for j in range(s+1)] for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(s+1):
        dp[i+1][j]+=2*dp[i][j]
        dp[i+1][j]%=mod
        if j+a[i]<=s:
            dp[i+1][j+a[i]]+=dp[i][j]
            dp[i+1][j+a[i]]%=mod
print(dp[n][s])

Buggy submission (verdict: Runtime Error):
import sys
import bisect
import math
import numpy as np
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from operator import itemgetter

n,s=map(int,readline().split())
a=list(map(int,readline().split()))
mod=998244353
dp=np.zeros((3030,3030),np.int64)
dp[0,0]=1
for i in range(n):
    for j in range(s+1):
        dp[i+1,j]+=2*dp[i,j]
        dp[i+1,j]%=mod
        if j+a[i]<=s:
            dp[i+1,j+a[i]]+=dp[i,j]
            dp[i+1,j+a[i]]%=mod
print(dp[n,s])
Problem p03632 (python)

Fixed submission:
a = list(input().split())

b = int(a[0])
c = int(a[1])
d = int(a[2])
e = int(a[3])

if max(b,d) < min(c,e):
    print(min(c,e)-max(b,d))       

elif max(b,d)>=min(c,e):
        print(0)

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

if max(a[0],a[2]) < min(a[1],a[3]):
    print(int(min(a[1],a[3])-int(max(a[0],a[2])))
              
              
              
else if max(a[0],a[2]) >= min(a[1],a[3]):
    print(0)
Problem p02694 (python)

Fixed submission:
x = int(input())
n = 100
 
for i in range(1000000):
	n = (n * 101) // 100
	if n >= x:
		print(i + 1)
		break

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

for i in range(1e5):
  n = (n * 101) // 100
  if n >= x:
	print(i + 1)
    break
Problem p03071 (python)

Fixed submission:
a,b = input().split()
M,m=max(int(a),int(b)),min(int(a),int(b))
if M==m:
  print(2*M)
else:
  print(2*M-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
s=1
for i in range(1,n):
  if l[i]>=max(l[0:i]):
    s=s+1
print(s)
Problem p03103 (python)

Fixed submission:
from operator import itemgetter
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split())
  l.append([a,b])
l.sort(key=itemgetter(0))
s=0
for j in range(n):
  s=s+l[j][0]*min(l[j][1],m)
  m=m-l[j][1]
  if m<0:
    break
print(s)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split)
  l.append([a,b])
l.sort(key=itemgetter(0))
s=0
for j in range(n):
  s=s+l[j][0]*min(l[j][1],m)
  m=m-l[j][1]
  if m<0:
    break
print(s)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split)
  l.append([a,b])
l.sort(key=itemgetter(0))
s=0
for j in range(n):
  s=s+l[j][0]*min(l[j][1],m)
  m=m-l[j][1]
  if m<0:
    break
return s
Problem p02585 (python)

Fixed submission:
import sys
def main():
  input = sys.stdin.readline
  n, k = map(int , input().split())
  p_list = list(map(int, input().split()))
  c_list = list(map(int, input().split()))
  res = -float('inf')
  
  for s in range(n):
    S = []
    i = p_list[s] - 1
    S.append(c_list[i])
    while i != s:
      i = p_list[i]-1
      S.append(S[-1] + c_list[i])
    if k <= len(S):
      score = max(S[:k])
    elif S[-1] <= 0:
      score = max(S)
    else:
      score1 = S[-1] * (k//len(S) - 1)
      score1 += max(S)
      
      score2 = S[-1] * (k//len(S))
      r = k%len(S)
      if r!=0:
        score2 += max(0, max(S[:r]))
      score = max(score1, score2)
    res = max(res, score)
  print(res)
      

if (__name__=='__main__'):
  main()

Buggy submission (verdict: Runtime Error):
import sys
def main():
  input = sys.stdin.readline
  n, k = map(int , input().split())
  p_list = list(map(int, input().split()))
  c_list = list(map(int, input().split()))
  
  dp = [[float('-inf')]*n for _ in range(k+1)]
  dp[0] = [0]*n
  for i in range(k):
    for j in range(n):
      if i==0:
        dp[i+1][p_list[j]-1] = dp[i][j]+c_list[j]
      else:
        dp[i+1][p_list[j]-1] = max(dp[i][p_list[j]-1], dp[i][j]+c_list[j])
  print(max(dp[-1]))

if (__name__=='__main__'):
  main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
def main():
  input = sys.stdin.readline
  n, k = map(int , input().split())
  p_list = np.array(list(map(int, input().split())))
  c_list = np.array(list(map(int, input().split())))
  
  dp = [[float('-inf')]*n for _ in range(k+1)]
  dp[0] = [0]*n
  for i in range(k):
    for j in range(n):
      if i==0:
        dp[i+1][p_list[j]-1] = dp[i][j]+c_list[j]
      else:
        dp[i+1][p_list[j]-1] = max(dp[i][p_list[j]-1], dp[i][j]+c_list[j])
  print(max(dp[-1]))

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

Fixed submission:
n = input()
list = [int(i) for i in input().split()]
print(abs(max(list)-min(list)))

Buggy submission (verdict: Runtime Error):
list = [int(i) for i in input()]
print(max(max(list)-min(list)))
Problem p03730 (python)

Fixed submission:
from fractions import gcd
a,b,c = map(int, input().split())
if c%gcd(a,b)==0:
  print('YES')
  exit()
print('NO')

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b,c = map(int, input().split())
if gcd(a,b)%c==0:
  print('Yes')
  exit()
print('No')
Problem p03029 (python)

Fixed submission:
a,p=map(int,input().split())
ans=(a*3+p)//2
print(ans)

Buggy submission (verdict: Runtime Error):
a,　p=map(int,input().split())
ans=(a*3+b)//2
print(ans)

Buggy submission (verdict: Runtime Error):
a,p=map(int,input().split())
ans=(a*3+b)//2
print(ans)
Problem p03369 (python)

Fixed submission:
s=input()
print(700+100*list(s).count('o'))

Buggy submission (verdict: Runtime Error):
s=input()
print(700+100*lsit(s).count('o'))

Buggy submission (verdict: Runtime Error):
s=input()
print(700+100*lsit(s).count('o'))

#組み込み関数というやつ？シンプルだけど覚えること多そう
Problem p03416 (python)

Fixed submission:
a,b=map(int,input().split())
cnt = 0
for i in range(a, b+1):
	if str(i) == str(i)[::-1]:
		cnt += 1
 
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
    if str(i)　==　str(i)[::-1]:
        cnt +=1　#count++はダメ
       
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
    if str(i)　==　str(i)[::-1]:
        cnt+=1　#count++はダメ
       
print(cnt)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    if str(i)　==　str(i)[::-1]:
        count+=1　#count++はダメ
       
print(count)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    if str(i)　==　str(i)[::-1]:
        count+=1　　#count++はダメ
       
print(count)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    if str(i)==str(i)[::-1]:
        count+=1　　#count++はダメ
       
print(count)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    if str(i)==str(i)[::-1]:
        count++
       
print(count)
Problem p03433 (python)

Fixed submission:
n=int(input())
a=int(input())
print("Yes" if n%500<=a else "No")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
print("Yes" if n%500<=a)
Problem p03477 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
print("Balanced" if a+b==c+d else "Left" if a+b>c+d else "Right")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print("balanced" if a+b=c+d else "left" if a+b>c+d else "right")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print("balanced" if a+b=c+d else "left" if a+b>c+d else "right")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print("balanced" if a+b=c+d else "left" if a+b>c+d else "right" a+b<c+d)
Problem p03547 (python)

Fixed submission:
x,y=map(str,input().split())
print("=" if x==y else ">" if x>y else "<")

Buggy submission (verdict: Runtime Error):
#要素の探索はlistで→stringでできんか？
list=["A","B","C","D","E","F"]
x=list.index(input())
y=list.index(input())
print("=" if x==y else ">" if x>y else "<")
Problem p02900 (python)

Fixed submission:
import fractions

def calc_factors(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

A, B = map(int, input().split())
g = fractions.gcd(A,B)
if g == 1:
    print(1)
else:
    print(len(set(calc_factors(g)))+1)

Buggy submission (verdict: Runtime Error):
import fractions

def calc_factors(n):
    i = 2
    f = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            f.append(i)
    if n > 1:
        f.append(n)
return f

A, B = map(int, input().split())
print(max(1,len(calc_factors(fractions.gcd(A,B)))))

Buggy submission (verdict: Runtime Error):
import math

def calc_factors(n):
    i = 2
    f = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            f.append(i)
    if n > 1:
        f.append(n)
    return f

A, B = map(int, input().split())
print(max(1,len(calc_factors(math.gcd(A,B)))))

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

def calc_factors(n):
    i = 2
    f = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            f.append(i)
    if n > 1:
        f.append(n)
    return f

A, B = map(int, input().split())
print(max(1,len(calc_factors(math.gcd(A,B)))))
Problem p03001 (python)

Fixed submission:
W, H, x, y = map(float, input().split())
if x == W/2 and y == H/2:
    print(W*H/2,1)
else:
    print(W*H/2,0)

Buggy submission (verdict: Runtime Error):
W, H, x, y = map(int, input().split())
# ansx = min([(W-x)*H,x*H])
# ansy = min([(H-y)*W,y*W])
if W/2 == y or H/2 == x or (W%x ==0 and H%y==0):
    print(W*H//2,1)
else:
    # print(max(ansx,ansy),0)
    print(W*H//2,0)
Problem p03129 (python)

Fixed submission:
l = map(int, raw_input().split())

if (l[0] >= (2 * l[1]) -1) :
	print("YES")

else :
	print("NO")

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K >= 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K >= 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K > 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco+1)

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K > 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)

Buggy submission (verdict: Runtime Error):
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K > 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)
Problem p03262 (python)

Fixed submission:
import fractions

N, X = map(int, input().split())
x = list(map(int, input().split()))

if N == 1:
    print(abs(x[0] - X))

else:
    diff = []

    for i in x:
        diff.append(abs(X - i))

    g = fractions.gcd(diff[0],diff[1])

    for i in range(1,len(diff)):
        g = fractions.gcd(g,diff[i])

    print(g)

Buggy submission (verdict: Runtime Error):
import math

N, X = map(int, input().split())
x = list(map(int, input().split()))

if N == 1:
    print(x[0] - X)

else:
    diff = []

    for i in x:
        diff.append(abs(X - i))

    g = math.gcd(diff[0],diff[1])

    for i in range(1,len(diff)):
        g = math.gcd(g,diff[i])

    print(g)
Problem p03565 (python)

Fixed submission:
S = list(input())
T = list(input())
ans = []

for i in range(len(S)-len(T)+1):
    for j in range(len(T)):
        if S[i+j] == '?' or S[i+j] == T[j]:
            continue
        else:
            break
    else:
        tmp = str("".join(S[:i] + T + S[i+len(T):]).replace('?','a'))
        ans.append(tmp)
if len(ans) == 0:
    print("UNRESTORABLE")
else:
    ans.sort()
    print(ans[0])

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())
for i in range(len(S)):
    if S[i] == T[0] or S[i] == '?':
        for j in range(len(T)):
            #print(T[j], S[i+j])
            if T[j] != S[i+j] and S[i+j] != '?':
                break
        else:
            for k in range(len(T)):
                S[i+k] = T[k]
            for k in range(len(S)):
                if S[k] == '?':
                    print('a',end="")
                else:
                    print(S[k],end="")
            print("")
            exit(0)
print("UNRESTORABLE")
Problem p03633 (python)

Fixed submission:
def gcd(x,y):
    z = x % y
    if z == 0:
        return y
    return gcd(y, z)

N = int(input())
T = [int(input()) for _ in range(N)]

for i in range(N-1):
   T[i+1] = (T[i] * T[i+1]) // gcd(T[i], T[i+1])
print(T[-1])

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
T = [int(input()) for _ in range(N)]

for i in range(N-1):
   T[i+1] = (T[i] * T[i+1]) // math.gcd(T[i], T[i+1])
print(T[-1])
Problem p03671 (python)

Fixed submission:
c = list(map(int, input().split()))
print(sum(c)-max(c))

Buggy submission (verdict: Runtime Error):
c = map(int, input().split())
print(sum(c)-max(c))
Problem p03760 (python)

Fixed submission:
O = input()
E = input()

if len(O) > len(E):
    for i in range(len(E)):
        print(O[i],end="")
        print(E[i],end="")
    print(O[i+1])
elif len(O) < len(E):
    for i in range(len(O)):
        print(E[i],end="")
        print(O[i],end="")
    print(O[i+1])
else:
    for i in range(len(O)):
        print(O[i],end="")
        print(E[i],end="")

Buggy submission (verdict: Runtime Error):
O = input()
E = input()
for i in range(len(O)):
    print(O[i],end="")
    print(E[i],end="")
Problem p03846 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort()
if N == 1:
    print(1)
    exit(0)

elif N % 2 == 0:
    for i in range(0,N//2+1,2):
        if A[i] == A[i+1]:
            continue
        else:
            print(0)
            exit(0)
else:
    for i in range(1,N//2+2,2):
        if A[i] == A[i+1]:
            continue
        else:
            print(0)
            exit(0)
print(2**(N//2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
if N % 2 == 0:
    for i in range(0,N//2+1,2):
        if A[i] == A[i+1]:
            continue
        else:
            print(0)
            exit(0)
else:
    for i in range(1,N//2+2,2):
        if A[i] == A[i+1]:
            continue
        else:
            print(0)
            exit(0)
print(2**(N//2)%(10**9+7))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
if N % 2 == 0:
    for i in range(N//2+1,2):
        if A[i] == A[i+1]:
            continue
        else:
            print(0)
            exit(0)
else:
    if A[0] == 0:
        for i in range(1,N//2+2,2):
            if A[i] == A[i+1]:
                continue
            else:
                print(0)
                exit(0)
    else:
        print(0)
        exit(0)
print(2**(N//2)%(10**9+7))
Problem p03854 (python)

Fixed submission:
S = input()
s = ["eraser","erase","dreamer","dream"]
for i in s:
    S = S.replace(i,"")

if len(S) == 0:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
S = input()[::-1]
T = ['maerd' ,'remaerd' ,'esare' ,'resare']
i, j = 0, 0
while True:
    if i == 4:
        break
    if T[i] == S[j:j+len(T[i])]:
        p += len(T[i])
        i = 0
    else:
        i += 1
print("YES" if len(S)==j else "NO")
Problem p03136 (python)

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
l.sort()
sum = 0
for i in range(n-1):
	sum += l[i]
if sum > l[n-1]:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int, input().split()))
l.sort()
sum = 0
for i in range(n-1):
	sum += i
if sum > a[n-1]:
	print('Yes')
else:
	print('No')
Problem p02718 (python)

Fixed submission:
n, m = map(int,input().split())
ls = list(map(int,input().split()))
a = 0
s = sum(ls)

for i in range(n):
    if ls[i] * m * 4 >= s:
        a += 1

if a >= m:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
12 3
4 56 78 901 2 345 67 890 123 45 6 789
Problem p02719 (python)

Fixed submission:
n, k = map(int,input().split())
a = n % k
b = k - a
if b <= a:
    print(b)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
c = a % b
if b - c <= c :
  print(b - c)
else :
  print(c)
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
c = 0
while a * c - c + 1 < b:
    c += 1
print(c)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = math.ceil(((b - 1) / a) + 1)
print(c)
Problem p03385 (python)

Fixed submission:
s = input()
if s[0] != s[1] and s[1] != s[2] and s[2] != s[0]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if s[0] != s[1] and s[1] != s[2] and s[1] != s[3]:
  print("Yes")
else:
  print("No")
Problem p03455 (python)

Fixed submission:
a,b = map(int,input().split())
c = (a * b) % 2
if c == 1 :
  print("Odd")
else :
  print("Even")

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = (a * b) % 2
if c == 1 :
  print(odd)
else :
  print(even)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = a * b % 2
if c == 1 :
  print(odd)
else :
  print(even)
Problem p03456 (python)

Fixed submission:
import math
a, b = input().split()
c = a + b
d = int(c)
e = math.sqrt(d) // 1
if d == e * e:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b = input().split()
c = a + b
d = int(c)
e = math.sqrt(d) // 1
if d == e ** e:
    print("Yes")
else:
    print("No")
Problem p02662 (python)

Fixed submission:
N, S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
dp = [[0 for j in range(S + 1)] for i in range(N + 1)]
dp[0][0] = 1
for i in range(N) : 
    for j in range(S + 1) : 
        dp[i + 1][j] += 2 * dp[i][j]
        dp[i + 1][j] %= mod 
        if j + A[i] <= S : 
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= mod
print(dp[N][S])

Buggy submission (verdict: Runtime Error):
N, S = map(int,input.split())
A = list(map(int, input.split()))
mod = 998244353
dp = [[0 for j in range(S+1)] for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
	for j in range(S+1):
		dp[i + 1][j] += 2 * dp[i][j]
		dp[i + 1][j] %= mod 
		if j + A[i] <= S : 
			dp[i + 1][j + A[i]] += dp[i][j]
			dp[i + 1][j + A[i]] %= mod
print(dp[N][S])

Buggy submission (verdict: Runtime Error):
N, S = map(int,input.split())
A = list(map(int, input.split()))
mod = 998244353
dp = [[0 for j in range(S+1)] for i in range(N+1)]
dp[0][0] = 1
for i in range(N):
	for j in range(S+1):
		dp[i + 1][j] += 2 * dp[i][j]
        dp[i + 1][j] %= mod 
        if j + A[i] <= S : 
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= mod
print(dp[N][S])