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

Fixed submission:
s,t = input(), input()
a = 0
for i in range(len(s)):
    if s[i]!=t[i]:
        a = a + 1
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input(), split()
a = 0
for i in range(len(s)):
    if s[i]==t[i]:
        a = a + 1
    else:
        a = a + 0
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input().split()
a = 0
for i in range(len(s)):
    if s[i]==t[i]:
        a = a + 1
    else:
        a = a + 0
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input().split()
a = 0
for i in range(len(t)):
    if s[i] == t[i]:
        a = a + 1
    else:
        a = a + 0
print(a)

Buggy submission (verdict: Runtime Error):
S,T = input().split()
a=0
for i in range(len(S)):
  if S[i]==T[i]:
      a=a+1
  else:
      a=a+0
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input().split()
a=0
for i in range(len(s)):
  if s[i]==t[i]:
      a=a+1
  else:
      a=a+0
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input().sprit()
a=0
for i in range(len(s)):
  if s[i]==t[i]:
      a=a+1
  else:
      a=a+0
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input().sprit()
a=0
for i in range(0,len(s)):
  if s[i]==t[i]:
    a=a+1
  else:
    a=a+0
print(a)

Buggy submission (verdict: Runtime Error):
s,t = input().sprit()
i=int(input())
a=0
if s[i]=t[i]:
    a=a+1
else:
    a=a+0
print(a)
Problem p02627 (python)

Fixed submission:
α = input()
if str.isupper(α):
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
α = input()
if str.isupper():
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
α = input()
If str.isupper(α) = True :
  print("A")
else :
  print("a")
Problem p02546 (python)

Fixed submission:
s = input()
if s[-1]=="s":
    t = s + "es"
else:
    t = s + "s"
print(t)

Buggy submission (verdict: Runtime Error):
N = int(input())
z = 0
for a in range(N):
    for b in range(N):
        c = N - (a+1)*(b+1)
        if c > 0:
            z = z+1
        else:
            pass
print(z)
Problem p02547 (python)

Fixed submission:
dice_num_list = []
equal_index_list = []

N = int(input())

for i in range(1, N + 1):
    d1, d2 = input().split(" ")
    dice_num_list.append([d1, d2])

equal_index_list = [i for i, x in enumerate(dice_num_list) if x[0] == x[1]]

l = len(equal_index_list)
if l < 3:
    print('No')
    exit(0)

for i in range(l - 2):
    if equal_index_list[i] + 1 == equal_index_list[i + 1] and equal_index_list[i] + 2 == equal_index_list[i + 2]:
        print("Yes")
        exit(0)

print("No")

Buggy submission (verdict: Runtime Error):
dice_num_list = []
equal_index_list = []

N = int(input())

for i in range(1, N + 1):
    d1, d2 = input().split(" ")
    dice_num_list.append([d1, d2])

equal_index_list = [i for i, x in enumerate(dice_num_list) if x[0] == x[1]]

if len(equal_index_list) < 3:
    print('No')
    exit(0)
for index in equal_index_list:
    if equal_index_list[index + 1] == index + 1 and equal_index_list[index + 2] == index + 2:
        print("Yes")
        exit(0)
print("No")
Problem p02570 (python)

Fixed submission:
type_in = input()
s = type_in.split(' ')
D = int(s[0])
T = int(s[1])
S = int(s[2])
if (D <= T * S):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
s = input()
D = float(s[0])
T = float(s[1])
S = float(s[2])
if (D > T * S):
	print("No")
else:
	print("Yes")
Problem p03107 (python)

Fixed submission:
S = input()

num_0 = S.count('0')
num_1 = S.count('1')

print(min(num_0, num_1)*2)

Buggy submission (verdict: Runtime Error):
def next_check(cubes):
	index_list = []
	for cube_index in reversed(range(1, len(cubes))):
		if ((cube_index not in index_list) and (cubes[cube_index] == cubes[cube_index - 1])):
			index_list.append(cube_index - 1)
			index_list.append(cube_index)
	l = len(index_list)
	for i in reversed(index_list):
		cubes.pop(i)
	return (cubes, l)

def main():
	cubes = input()
	for c in cubes:
		if c not in ['0', '1']:
			exit(0)
	cube_list = []
	for cube in cubes:
		cube_list.append(cube)
	l = len(cube_list)
	k = 0
	while (l != 0):
		cubes, l = next_check(cube_list)
		k += l
	print(k)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
def next_check(cubes):
	index_list = []
	for cube_index in range(1, len(cubes)):
		if cube_index not in index_list and cubes[cube_index] == cubes[cube_index - 1]:
			index_list.append(cube_index - 1)
			index_list.append(cube_index)
	l = len(index_list)
	for i in reversed(index_list):
		cubes.pop(i)
	return (cubes, l)


cubes = input()
for c in cubes:
	if c not in ['0', '1']:
		exit(0)
cube_list = []
for cube in cubes:
	cube_list.append(cube)
l = len(cube_list)
k = 0
while (l != 0):
	cubes, l = next_check(cube_list)
	k += l
print(k)

Buggy submission (verdict: Runtime Error):
def next_check(cubes):
	index_list = []
	for cube_index in range(1, len(cubes)):
		if cube_index not in index_list and cubes[cube_index] == cubes[cube_index - 1]:
			index_list.append(cube_index - 1)
			index_list.append(cube_index)
	l = len(index_list)
	for i in reversed(index_list):
		cubes.pop(i)
	return (cubes, l)


cubes = input()
for c in cubes:
	if c not in ['0', '1']:
		exit(0)
cube_list = []
for cube in cubes:
	cube_list.append(cube)
l = len(cube_list)
k = 0
while (l != 0):
	cubes, l = next_check(cube_list)
	k += l
print(k)

Buggy submission (verdict: Runtime Error):
	index_list = []
	for cube_index in range(1, len(cubes)):
		if cube_index not in index_list and cubes[cube_index] == cubes[cube_index - 1]:
			index_list.append(cube_index - 1)
			index_list.append(cube_index)
	l = len(index_list)
	for i in reversed(index_list):
		cubes.pop(i)
	return (cubes, l)


cubes = input()
for c in cubes:
	if c not in ['0', '1']:
		exit(0)
cube_list = []
for cube in cubes:
	cube_list.append(cube)
l = len(cube_list)
k = 0
while (l != 0):
	cubes, l = next_check(cube_list)
	k += l
print(k)
Problem p02546 (python)

Fixed submission:
s = input()
if s[-1] == 's':
  print(s + 'es')
else:
  print(s + 's')

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
for C in range(1,N):
  for A in range(1,N-C+1):
    B = (N-C)/A
    if B.is_integer():
      count += 1
print(count)
Problem p02578 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
 
total = 0
dif = 0
for i in range(1,N):
  if (A[i-1]+dif)-A[i]>0:
    total += (A[i-1]+dif)-A[i]
    dif = (A[i-1]+dif)-A[i]
  else:
    dif = 0
print(total)

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

if A[0]-A[1]>0:
  total = A[0]-A[1]
else:
  total=0 
dif = total
for i in range(1,N):
  if (A[i-1]+dif)-A[i]>0:
    total += (A[i-1]+dif)-A[i]
    dif = (A[i-1]+dif)-A[i]
  else:
    dif = 0
print(total)

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

if A[0]-A[1]>0:
  total = A[0]-A[1]
else:
  total=0 
dif = total
for i in range(1,N-1):
  if (A[i-1]+dif)-A[i]>0:
    total += (A[i-1]+dif)-A[i]
    dif = (A[i-1]+dif)-A[i]
  else:
    dif = 0
print(total)
Problem p02546 (python)

Fixed submission:
s=input()

if s.endswith("s"):
    print(s+"es")
else:
    print(s+"s")

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

for num in range(n):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        count += 1
else:
    if count>0:
        print("Yes")
    else:
        print("No")
Problem p02547 (python)

Fixed submission:
n = int(input())
count=0
flg=0

for num in range(n):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        count += 1
        if count>= 3:
            flg = 1
    else:
        count=0
else:
    if count > 3 or flg >0:
        print("Yes")
    else:
        print("No")

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

for num in range(n):
    d1,d2 = map(int,input().split())
    if d1 == d2:
        count += 1
else:
    if count>0:
        print("Yes")
    else:
        print("No")v
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
 
tmp1 = N // (A + B)
tmp2 = N % (A + B)
 
print(tmp1 * A + min(tmp2, A))

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
 
tmp1 = N // (A + B)
tmp2 = N % (A + B)
 
print(tmp1 * A + mim(tmp2, A))
Problem p02766 (python)

Fixed submission:
N,K = map(int, input().split())
 
counter = 1
tmp = 1
while True:
    tmp *= K
    if tmp > N:
        break
    counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input(),split())

counter = 1
tmp = 1
while true:
    tmp *= K
    if tmp > N
        break
    counter += 1
print(counter)
Problem p02594 (python)

Fixed submission:
x = int(input())

if x >= 30:
    print("Yes")
else:
    print("No")

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

    if x >= 30:
        print("Yes")
    else:
        print("No")
Problem p02699 (python)

Fixed submission:
s,w = map(int,input().split())
if w > s or w == s:
  print("unsafe") 
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w = map(int,input().split())
if w > s or w = s:
  print("unsafe") 
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w = int(input().split())
if w > s:
  print("unsafe") 
else:
  print("safe")
Problem p02546 (python)

Fixed submission:
s=str(input())
if(s[-1]=="s"):
  	print(s+"es")
else:
	print(s+"s")

Buggy submission (verdict: Runtime Error):
s=input()
if s[-1]=='s':
  	s+='es'
  	return s
s+='s'
return s

Buggy submission (verdict: Runtime Error):
s=input()
if s[-1]=='s':
  s+='es'
  return s
s+='s'
return s

Buggy submission (verdict: Runtime Error):
input = input()
if input[-1]=='s':
  return input.append('es')
else:
  return input.append('s')
Problem p02597 (python)

Fixed submission:
import sys
N = int(input())
c = input()
ans = 0
exchange = 0
for i in range(N):
    if c[i] == "W":
        exchange = i
        break
else:
    print(0)
    sys.exit()

for i in range(N):
    if N-i > exchange:
        if c[-(i+1)] =="R":
            # c = list(c)
            # c[exchange] = "R"
            # c[-(i+1)] = "W"
            # c = "".join(c)
            # c = c[:exchange]+"R"+c[exchange+1:]
            # print("newc=",c)
            # c = c[:-(i+1)]+"W"+c[N-i:]
            # print("newc=",c)
            ans += 1
            for k in range(exchange+1,N-(i+1)):
                if c[k] == "W":
                    exchange = k
                    break
            else:
                break
    else:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
c = input()
ans = 0
exchange = 0
for i in range(N):
    if c[i] == "W":
        exchange = i
        break
else:
    print(0)
    sys.exit()

for i in range(N//2):
    # print(i+1,"回目")
    # print("exchange=",exchange)
    # print("c=",c)
    if c[-(i+1)] =="R":
        # c = list(c)
        # c[exchange] = "R"
        # c[-(i+1)] = "W"
        # c = "".join(c)
        c = c[:exchange]+"R"+c[exchange+1:]
        print("newc=",c)
        c = c[:-(i+1)]+"W"+c[N-i:]
        # print("newc=",c)
        ans += 1
        for k in range(exchange+1,N):
            if c[k] == "W":
                exchange = k
                break
        else:
            break
    
print(ans)
Problem p02699 (python)

Fixed submission:
S,W = list(map(int,input().split()))

if S <= W:
    print("unsafe")
else:
    print("safe")

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

if S =< W:
    print("unsafe")
else:
    print("safe")
Problem p02881 (python)

Fixed submission:
Input = int(input())

aa = int(Input**0.5)

for i in range(1,aa+1):
  if Input%(aa+1-i) == 0:
    num1 = aa+1-i
    num2 = Input/(aa+1-i)
    break
print(int(num1 + num2 -2))

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

point =[]
for i in range(Input[0]):
    point.append(0)

for i in range(Input[2]):
    aa = int(input())
    point[aa-1] +=1
gouhi =[]
for i in range(Input[0]):
    bb = 0
    if Input[1]-Input[2]+point[i] > 0 :
        bb = "Yes"
    else:
        bb = "No"
    gouhi.append(bb)
print("\n".join(gouhi))
Problem p02546 (python)

Fixed submission:
S = input()
if S[-1]=='s':
    s = S+'es'
else:
    s = S+'s'
print(s)

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1

    else:
        count=0
if c==1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1
            sys.exit()
    else:
        count=0
if c==1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1
    else:
        count=0
if count==1:
    print('Yes')
else:
    print('No')
Problem p02547 (python)

Fixed submission:
N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1

    else:
        count=0
if c==1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
count = 0
c = 0
for i in range(N):
    d1,d2 = input().split()
    if d1==d2:
        count+=1
        if count==3:
            c =1
            sys.exit()
    else:
        count=0
if count==1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = input()
count = 0
c = 0
for i in range(N):
    d1,d2,d3 = input().split()
    if (d1==d2)&(d2==d3):
        count+=1
        if count=3:
            c =1
            sys.exit()
    else:
        count=0
if count=1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = input()
count = []
for i in range(N):
    d1,d2,d3 = input().split()
    if (d1==d2)&(d2==d3):
        print('Yes')
        sys.exit()
    else:
        count.append(0)
if sum(count)==0:
    print('No')
Problem p02723 (python)

Fixed submission:
str = input()

if str[2] == str[3] and str[4] == str[5]:
    print("Yes")
else:
    print("No")

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

#posの隣同士の差を格納
#最も差が大きいポジションに対して、CCWとCWを考えて、小さいほうを採用

#差を格納
subtract = []
for i in range(n-1):
    subtract.append(pos[i+1]-pos[i])

#差を格納(posの終点～posの始点)
subtract.append(k-pos[n-1]+pos[0])

#差の配列から、最大差のインデックス番号を取得
idx = subtract.index(max(subtract))

if idx == 0:
    rsl = k-pos[idx-1]+pos[0]
else:
    rsl = pos[n-1]-pos[0]

print(rsl)
Problem p02550 (python)

Fixed submission:
N,X,M=map(int,input().split())
t=[]
t.append(X)
temp=X
ans=X
for i in range(10**5+100):
    temp=temp**2%M
    if temp in t:
        firstindex=t.index(temp)
        currentindex=len(t)
        firstsum=0
        for i in range(firstindex):
            firstsum+=t[i]
        repeatsum=0
        for i in range(firstindex,currentindex):
            repeatsum+=t[i]
        repetition=(N-firstindex)//(currentindex-firstindex)
        lastrep=        (N-firstindex)%(currentindex-firstindex)
        lastsum=0
        for i in range(firstindex,firstindex+lastrep):
            lastsum+=t[i]
        print(firstsum+repetition*repeatsum+lastsum)
        exit()

    else:
        t.append(temp)

Buggy submission (verdict: Runtime Error):
N,X,M=map(int,input().split())
t=[]
t.append(X)
temp=X
ans=X
for i in range(10**5+100):
    temp=temp**2%M
    if temp in t:
        firstindex=t.index(temp)
        currentindex=len(t)
        firstsum=0
        for i in range(firstindex-1):
            firstsum+=t[i]
        repeatsum=0
        for i in range(firstindex,currentindex):
            repeatsum+=t[i]
        repetition=(n-firstindex)//(currentindex-firstindex)
        lastrep=        (n-firstindex)%(currentindex-firstindex)
        lastsum=0
        for i in range(firstindex,firstindex+lastrep):
            lastsum+=t[i]

    else:
        t.append(temp)
    

print(firstsum+repetition*repeatsum+lastsum)
Problem p02623 (python)

Fixed submission:
N,M,K=map(int,input().split())
At=list(map(int,input().split()))
Bt=list(map(int,input().split()))

#０冊を初期値にする
A=[0]
B=[0]


for a in At:
    if A[-1]+a<=K:
        A.append(A[-1]+a)
    else:
        break
for b in Bt:
    if B[-1]+b<=K:
        B.append(B[-1]+b)
    else:
        break

def is_ok(arg):
    # 条件を満たすかどうか？問題ごとに定義
    if Ak+B[arg]<=K:
        return True
    else:
        return False


def meguru_bisect(ng, ok):
    '''
    めぐる2分探査
    okはBの冊数たりうる値
    ngはBの冊数たり得ない値を入れる。
    '''

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


Ak=0

maxBooks=0
for Ai in range(len(A)): 
    Ak=A[Ai]
    Bi=meguru_bisect(len(B),0) #len(B)は配列の要素数として使われるとき最大＋１
    if maxBooks<(Ai+Bi):
        maxBooks=Ai+Bi
print( maxBooks )

Buggy submission (verdict: Runtime Error):
N,M,K=map(int,input().split())
At=list(map(int,input().split()))
Bt=list(map(int,input().split()))

#０冊を初期値にする
A=[0]
B=[0]


for a in At:
    if A[-1]+a<K:
        A.append(A[-1]+a)

for b in Bt:
    if B[-1]+b<K:
        B.append(B[-1]+b)

def is_ok(arg):
    # 条件を満たすかどうか？問題ごとに定義
    if Ak+B[arg]<=K:
        return True
    else:
        return False


def meguru_bisect(ng, ok):
    '''
    めぐる2分探査
    okはBの冊数たりうる値
    ngはBの冊数たり得ない値を入れる。
    '''

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


Ak=0

maxBooks=0
for Ai in range(len(A)): 
    Ak=A[Ai]
    Bi=meguru_bisect(len(B),0) #len(B)は配列の要素数として使われるとき最大＋１
    if maxBooks<(Ai+Bi):
        maxBooks=Ai+Bi
print( maxBooks )

Buggy submission (verdict: Runtime Error):
N,M,K=map(int,input().split())
At=list(map(int,input().split()))
Bt=list(map(int,input().split()))

#０冊を初期値にする
A=[0]
B=[0]


for a in At:
    if A[-1]+a<K:
        A.append(A[-1]+a)

for b in Bt:
    if B[-1]+b<K:
        B.append(B[-1]+b)
print (A,B)

def is_ok(arg):
    # 条件を満たすかどうか？問題ごとに定義
    if Ak+B[arg]<=K:
        return True
    else:
        return False


def meguru_bisect(ng, ok):
    '''
    めぐる2分探査
    okはBの冊数たりうる値
    ngはBの冊数たり得ない値を入れる。
    '''

    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok


Ak=0

maxBooks=0
for Ai in range(len(A)): 
    Ak=A[Ai]
    Bi=meguru_bisect(len(B),0) #len(B)は配列の要素数として使われるとき最大＋１
    if maxBooks<(Ai+Bi):
        maxBooks=Ai+Bi
print( maxBooks )
Problem p02627 (python)

Fixed submission:
let = input()
if let == let.upper():
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
num = int(input())
line = []

while num >= 27:
  amari = num%26
  num = num//26
  line.append(amari)
if num < 27:
  line.append(num)

  
alpha = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
line.reverse()
for k in line:
  print(alpha[int(k)-1], end = "")
Problem p02595 (python)

Fixed submission:
import numpy as np

N, D = map(int, input().split())
xy = np.array([list(map(int, input().split())) for xy in range(N)])
o = np.array([0, 0])
count = 0

for i in range(N):
    if np.linalg.norm(xy[i] - o) <= D:
        count += 1
    else:
        pass

print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np

N, D = map(int, input().split())
xy = np.array([list(map(int, input().split())) for xy in range(N)])
o = np.array([0, 0])
count = 0

for i in range(N):
    if np.linalg.norm(xy[i] - o) <= D:
        count += 1
    else:
        pass

print(count)

Buggy submission (verdict: Runtime Error):
from scipy.spatial import distance

N, D = map(int, input().split())
xy = [list(map(int, input().split())) for xy in range(N)]
o = [0, 0]
count = 0

for i in range(N):
    if distance.euclidean(xy[i], o) <= D:
        count += 1
    else:
        pass

print(count)
Problem p02729 (python)

Fixed submission:
from math import factorial

N, M = map(int, input().split())

if N <= 1:
    combN = 0
else:
    combN = factorial(N) // (factorial(N - 2) * factorial(2))

if M <= 1:
    combM = 0
else:
    combM = factorial(M) // (factorial(M - 2) * factorial(2))

print(combN + combM)

Buggy submission (verdict: Runtime Error):
from math import factorial

N, M = map(int, input().split())

if N == 0:
    combN = 0
else:
    combN = factorial(N) // (factorial(N - 2) * factorial(2))

if M == 0:
    combM = 0
else:
    combM = factorial(M) // (factorial(M - 2) * factorial(2))

print(combN + combM)
Problem p03327 (python)

Fixed submission:
N = int(input())

if N < 1000:
    print('ABC')
else:
    print('ABD')

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

if N < 1000:
    print('ABC')
else:
    print('ABD')
Problem p02552 (python)

Fixed submission:
x=int(input())
if x==0:
  ans=1
elif x==1:
  ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
x=int(input())
if x==0:
  ans=1
else x==1:
  ans=0
  
print(ans)
Problem p02729 (python)

Fixed submission:
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,m=map(int,input().split())
if (n<=1) and (m<=1):
  ans=0
else:
  if n<=1:
    ans=comb(m,2)
  elif m<=1:
    ans=comb(n,2)
  else:
    ans=comb(n,2)+comb(m,2)
  
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,m=map(int,input().split())
if (n<=1) and (m<=1):
  ans=0
else:
  if n==0:
    ans=comb(m,2)
  elif m==0:
    ans=comb(n,2)
  else:
    ans=comb(n,2)+comb(m,2)
  
print(ans)

Buggy submission (verdict: Runtime Error):
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,m=map(int,input().split())
if (n<=1) and (m<=1):
  ans=0
elif (n==0) or (m==0):
  ans=0
else:
  ans=comb(n,2)+comb(m,2)
  
print(ans)
Problem p02819 (python)

Fixed submission:
import math
x=int(input())
def eratosthenes(n):
    """n以下の素数をエラトステネスの篩によって求める.リストをかえす"""
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
ans=eratosthenes(10**5+3)
for i in  range(len(ans)):
    if ans[i]>=x:
        print(ans[i])
        exit()
    else:
        pass

Buggy submission (verdict: Runtime Error):
import math
x=int(input())
def eratosthenes(n):
    """n以下の素数をエラトステネスの篩によって求める.リストをかえす"""
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
ans=eratosthenes(10**5+3)
for i in  range(len(ans)):
	if ans[i]>=x:
    	print(ans[i])
	else:
      pass
Problem p03327 (python)

Fixed submission:
N=int(input())
a='ABD'
b='ABC'

if N<=999:
  print(b)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
N=int(input())
a='ABD'
b='ABC'
if a<=999:
  print(b)
else:
  print(a)

Buggy submission (verdict: Runtime Error):
N=int(input())
a='ABD'
b=N+1
print(a+b)
Problem p02546 (python)

Fixed submission:
S=input()
if S[-1:]=="s":
    print(S+"es")
else:
    print(S+"s")

Buggy submission (verdict: Runtime Error):
S=input()
if S[-1]==s:
    print("S"+"es")
else:
    print("S"+"s")

Buggy submission (verdict: Runtime Error):
S=input()
if S[-1]==s:
    print(S+"es")
else:
    print(S+"s")

Buggy submission (verdict: Runtime Error):
S=str(input())
if S[-1]==s:
    print(S+"es")
else:
    print(S+"s")

Buggy submission (verdict: Runtime Error):
S=str(input())
if S[-1]==s:
    print(S+"es")
else:
    print(S+"s")

Buggy submission (verdict: Runtime Error):
S=str(input())
if s[-1]=s:
    print(S+"es")
else:
    print(S+"s")
Problem p02552 (python)

Fixed submission:
x=int(input())
if x==0:
    print("1")
else:
    print("0")

Buggy submission (verdict: Runtime Error):
x=int(input())
if x==0;
    print(1)
else;
    print(0)