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

Fixed submission:
n=list(input())
s=[1 for i in range(len(n)//2) if n[i]==n[len(n)-i-1]]
print("Yes" if len(s)==len(n)//2 else "No")

Buggy submission (verdict: Runtime Error):
from collections import *
from heapq import*
import sys
input=lambda:sys.stdin.readline()

d=defaultdict(list)
n=int(input())

for s in range(n-1):
    a,b,c=map(int,input().split())
    d[a].append([b,c])
    d[b].append([a,c])
#defaultdict(<class 'list'>, {1: [[2, 1], [3, 1]], 2: [[1, 1], [3, 3]], 3: [[1, 1], [2, 3]]})

def DIJKSTRA(point,d):
    cost      = {node:float("inf") for node in d.keys()}
    Q         = []  #頂点のリスト
    cost[point]=0  #開始地点のコストをゼロとする（当たり前
    heappush(Q,(point,cost[point]))
    while Q:
        prefnd,tmpC=heappop(Q)
        if cost[prefnd]<tmpC:
            continue
        for node,c in d[prefnd]:
            altC=c+tmpC
            if cost[node]>altC:
                cost[node]=altC
                heappush(Q,(node,altC))
    return cost

q,k=map(int,input().split())
y=DIJKSTRA(k,d)

for i in range(q):
    a,b=map(int,input().split())
    print(y[a]+y[b])

Buggy submission (verdict: Runtime Error):
from collections import *
d=defaultdict(list)
n=int(input())

for s in range(n-1):
    a,b,c=map(int,input().split())
    d[a].append([b,c])
    d[b].append([a,c])

#defaultdict(<class 'list'>, {1: [[2, 1], [3, 1]], 2: [[1, 1], [3, 3]], 3: [[1, 1], [2, 3]]})
 
def DIJKSTRA(point,d):
    cost      = {node:float("inf") for node in d.keys()}
    preference= {node:None         for node in d.keys()}#最適路のこと 
    Q         = set(d.keys())  #頂点のリスト
    cost[point]=0  #開始地点のコストをゼロとする（当たり前
    while True:
        prefnd=min(Q, key=lambda c:cost[c]) #最適な点探し
        Q.remove(prefnd)  #最適だった点を削除
        if len(Q)==0:
            break #全部の点消したら終了
        for p,c in d[prefnd]:  #次の点とそこまでのコスト
            temp=cost[prefnd]+c  #スタートからそこまでのコストを計算
            if temp<cost[p]:   #計算してみたコストがそこに行くまでの最小値ならば
                cost[p]=temp #最小値更新
                preference[p]=prefnd
    return preference,cost  #点のつながりとコスト例 1から１に０ １から２に１ １から３に２

q,k=map(int,input().split())
x,y=DIJKSTRA(k,d)

for i in range(q):
    a,b=map(int,input().split())
    print(y[a]+y[b])

Buggy submission (verdict: Runtime Error):
import collections as c
 
d=c.defaultdict(list)
n=int(input())
for s in range(n-1):
    a,b,c=map(int,input().split())
    d[a].append([b,c])
    d[b].append([a,c])
 
def DFS(point,d,cost,TFlist): #入力と同じindex系
    for s in d[point]:
        try:
            p=s[0]
            c=s[1]+cost[point]
            if TFlist[p-1]:
                continue
            cost[p]+=c
            TFlist[p-1]=1
            DFS(p,d,cost,TFlist)
        except:
            continue
 
cost=[None]+[0 for i in range(n)]
q,k=map(int,input().split())
TFlist=[0 for i in range(n)]
TFlist[k-1]=1
DFS(k,d,cost,TFlist)
 
for t in range(q):
    a,b=map(int,input().split())
    print(cost[a]+cost[b])
Problem p03705 (python)

Fixed submission:
n,a,b=map(int,input().split())
if b<a:
    print(0)
elif n==1:
    if a==b:
        print(1)
    else:
        print(0)
else:
    print( a+b*(n-1) - (a*(n-1)+b) +1 )

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
    
if n==1:    
    if a==b:
        print(1)
    else:
        print(0)
elif n==2:
    if b<a:
        print(0)
    else:
        print(1)
else:
    if b<a:
        print(0)
    elif a==b:
        print(1)
    else:
        print(sum(list(range(b-a+2))[::-1][:n-2]))

Buggy submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
    
if n==1:    
    if a==b:
        print(1)
    else:
        print(0)
elif n==2:
    if b<a:
        print(0)
    else:
        print(1)
else:
    if b<a:
        print(0)
    else:
        print(sum(list(range(b-a+2))[::-1][:n-2]))
Problem p03745 (python)

Fixed submission:
n,*a=map(int,open(0).read().split())
tmp=0
ans=1
for i in range(len(a)-1):
    dif=a[i+1]-a[i]
    if tmp==0:
        tmp=dif
    elif dif*tmp<0:
        ans+=1
        tmp=0

print(ans)

Buggy submission (verdict: Runtime Error):
n,*a=map(int,open(0).read().split())

ans=0
x=a[0]
if a[1]>a[0]:
  mode=0
else:
  mode=1
for s in a:
#  print(x,s,mode,ans)
  if x<s and mode==0:
    ans+=1
    mode=1
  elif x>s and mode==1:
    ans+=1
    mode=0
  x=s
print(ans//2+1)
Problem p03785 (python)

Fixed submission:
n,c,k,*t=map(int,open(0).read().split())
t.sort()
totalbus=1
bus=0
time=t[0]
for i in range(n):
    bus+=1
    if t[i]>time+k or bus>c:
        time=t[i]
        totalbus+=1
        bus=1
print(totalbus)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
v=sorted([int(input())for i in range(a)])
print(v)
bus=[]
ans=0
for i in range(a-1):
    
    if v[i]+c<v[i+1]:
        ans+=1
        bus=[]
        if i==a-2:
            ans+=1
    else:
        bus.append(v[i])
        print(bus)
        if len(bus)>=b:
            ans+=1
            bus=[]
if len(bus)>0:
    ans+=1
print(ans)
Problem p03803 (python)

Fixed submission:
a,b=map(int,input().split())
if a==1:a+=13
if b==1:b+=13
if a>b:print("Alice")
elif b>a:print("Bob")
else:print("Draw")

Buggy submission (verdict: Runtime Error):
from collections import *
n,m=map(int,input().split())
d=defaultdict(list)
for s in m*[0]:
    a,b=map(int,input().split())
    d[a].append(b)
    d[b].append(a)
def DFS_dict(point,TFlist):
    if all(TFlist):
        return 1
    ans=0
    for i in d[point]:
        if TFlist[i-1]:
            continue
        TFlist[i-1]=True
        ans+=DFS_dict(i,TFlist)
        TFlist[i-1]=False
    return ans
TFlist=[True]+[False]*(n-1)
print(DFS_dict(1,TFlist))
Problem p03805 (python)

Fixed submission:
n,m=map(int,input().split())
AdjacencyMatrix=[[0]*n for i in [0]*n]
for i in [0]*m:
  a,b=map(int,input().split())
  AdjacencyMatrix[a-1][b-1]=1
  AdjacencyMatrix[b-1][a-1]=1
#print(AdjacencyMatrix)

def DFS(point,TFlist):
#  print(TFlist)
  if not False in TFlist:
    return 1
  ans=0
  for i in range(n):
    if not AdjacencyMatrix[point][i]:
      continue  #AMの0なら処理せず
    if TFlist[i]:
      continue  #探索済みなら処理せず
    TFlist[i]=True #探索したのでTFlistをTrue
    ans+=DFS(i,TFlist) #再帰的にansを加算
    TFlist[i]=False #枝を戻すためにTFlistをFalse
  return ans

TFlist=[True]+[False]*(n-1)
print(DFS(0,TFlist))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
AdjacencyMatrix=[[0]*n for i in [0]*m]
for i in [0]*m:
  a,b=map(int,input().split())
  AdjacencyMatrix[a-1][b-1]=1
  AdjacencyMatrix[b-1][a-1]=1
#print(AdjacencyMatrix)

def DFS(point,TFlist):
#  print(TFlist)
  if not False in TFlist:
    return 1
  ans=0
  for i in range(n):
    if not AdjacencyMatrix[point][i]:
      continue  #AMの0なら処理せず
    if TFlist[i]:
      continue  #探索済みなら処理せず
    TFlist[i]=True #探索したのでTFlistをTrue
    ans+=DFS(i,TFlist) #再帰的にansを加算
    TFlist[i]=False #枝を戻すためにTFlistをFalse
  return ans

TFlist=[True]+[False]*(n-1)
print(DFS(0,TFlist))
Problem p03834 (python)

Fixed submission:
print(" ".join(input().split(",")))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split());print(sum(a>=b-s-t>=0for t in range(a+1)for s in range(a+1)))
Problem p02707 (python)

Fixed submission:
import collections

n = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)

for i in range(1,n+1):
  print(c[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().sprit()))
for i in range(1,n):
  print(A.count(i))
Problem p02831 (python)

Fixed submission:
from fractions import gcd

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

A,B = map(int,input().split())

print(lcm(A,B))

Buggy submission (verdict: Runtime Error):
import math

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

A,B = map(int,input().split())

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

Fixed submission:
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())

n = []
n = make_divisors(N)

cnt = 999999999999999
if len(n) >= 2:
    for i in range(0,len(n),2):
        t = int(n[i])-1 + int(n[i+1])-1
        if cnt > t:
            cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())

n = []
n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = int(n[i])-1 + int(n[i+1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())

n = []
n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = int(n[i])-1 + int(n[i+1])-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())

n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = n[i]-1 + n[i+1]-1
    if cnt > t:
        cnt = t
print(cnt)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())

n = make_divisors(N)

cnt = 999999999999
for i in range(0,len(n),2):
    t = n[i]-1 + n[i+1]-1
    if cnt > t:
        cnt = t
print(cnt)
Problem p02701 (python)

Fixed submission:
n = int(input())
A = [input() for i in range(n)]
print(-len(A) + len(set(A)) + n)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = []
cnt = 0
for i in xrange(n):
    m = input()
    if m not in A:
        A.append(m)
        cnt += 1
print(cnt)
Problem p02699 (python)

Fixed submission:
data = []
while len(data) < 2:
    val = input()
    data = data + val.split(" ")
    #print(data)

for i,val in enumerate(data):
    data[i] = int(val)

s,w = data[0],data[1]

if s <= w:
    print("unsafe")

else:
    print("safe")

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

if s <= w:
    print("unsafe")

else:
    print("safe")
Problem p02880 (python)

Fixed submission:
n=int(input())
f=0
for i in range(1,10,1):
  if n%i==0:
    if (n//i)<=9:
      f=1
      break
if f==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(1,10):
  if n%i==0:
    if n/i <=9:
      f=1
      break
if f==0:
  print('No')
else:
  print('YES')
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2==0:
  print((n//2)/n)
else:
  print(((n//2)+1)/n)

Buggy submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print((n//2)/n)
else:
  print(((n//2)+1)/n)
Problem p02897 (python)

Fixed submission:
n = int(input())
if n == 1:
    print(1)
elif n % 2 == 0:
    print(0.5)
else:
    print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    for j in range(n):
        if a[j] == (i+1):
            if (i+1) != n:
                print(j+1, end = " ")
            else:
                print(j+1)
Problem p02835 (python)

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

if a+b+c>=22: print("bust")
else: print("win")

Buggy submission (verdict: Runtime Error):
input_a=input("a:")
input_aa=input("aa:")
input_aaa=input("aaa:")

a=int(input_a)
aa=int(input_aa)
aaa=int(input_aaa)

if a+aa+aaa>=22: print("bust")
else: print("win")

Buggy submission (verdict: Runtime Error):
input_a=input()
input_aa=input()
input_aaa=input()

a=int(input_a)
aa=int(input_aa)
aaa=int(input_aaa)

if a+aa+aaa>=22: print("bust")
else: print("win")
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S, W = map(int,input.split())
if S <= W:
  print("unsafe")
else:print("safe")

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

Fixed submission:
n=int(input())
l=[]
for i in range(n):
  l.append(input())
s=set(l)
print(len(s))

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
  print(i)
  l.append(input())
print(len(s))
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
if S <= W:
  return "unsafe"
else:
  return "safe"

Buggy submission (verdict: Runtime Error):
if S<= W:
  print("unsafe")
 else:
  print("safe)
Problem p02699 (python)

Fixed submission:
S,W=map(int,input().split())
 
if S>W:
	print("safe")
else:
	print("unsafe")

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

while True:
    z=z-y
    if z<=0:
        print("Yes")
        break
    x=x-w
    if x<=0:
        print("No")
        break
Problem p02699 (python)

Fixed submission:
s = input()
l = [int(item) for item in s.split()]
if l[0] <= l[1]:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
a, b = raw_input()
if a < b:
  print(unsafe)
else:
  print(safe)

Buggy submission (verdict: Runtime Error):
a, b = input()
if a < b:
  print(unsafe)
else:
  print(safe)
Problem p02701 (python)

Fixed submission:
N = int(input(""))
M = []
n = 0

for i in range(N):
    p = input("")
    M.append(p)

Mm = list(set(M))

print(len(Mm))

Buggy submission (verdict: Runtime Error):
I = input("")
i = I.split(" ")
print(i)

N = int(i[0])
l = []
t = 0

for k in range(N):
    if i[k+1] not in l:
        l.append(i[k+1])
        t = t+1
print(len(l))

Buggy submission (verdict: Runtime Error):
I = input("")
i = I.split("\n")

N = int(i[0])
l = []
t = 0

for k in range(N):
    if i[k+1] not in l:
        l.append(i[k+1])
        t = t+1
print(len(l))
Problem p02729 (python)

Fixed submission:
# number of even balls, number of odd balls
N, M = list(map(int, input().split()))

total_choice = 0

if N > 1:
    total_choice += N*(N-1)/2

if M > 1:
    total_choice += M*(M-1)/2

print(int(total_choice))

Buggy submission (verdict: Runtime Error):
# number of balls
N = input()
# ball values
K = list(map(int, input().split()))

# get ball counts
ball_counts = {}
for i in range(len(K)):
    ball_value = K[i]
    if ball_value in ball_counts:
        ball_counts[ball_value] += 1
    else:
        ball_counts[ball_value] = 1

# get sums
total_sum = 0
for value, count in ball_counts.items():
    total_sum += (count * (count - 1)) / 2

# remove extra
for i in range(len(K)):
    ball_value = K[i]
    print(int(total_sum - (ball_counts[ball_value] - 1)))
Problem p02754 (python)

Fixed submission:
# N: number of balls to take, A: blue, B: red
N, A, B = list(map(int, input().split()))

if N == 0:
    print(0)

if A + B < N:
    # want to know how much A + B blocks can we place such that A + B < N (i.e. solve x(A+B) < N)
    blocks = int(N/(A+B))
    # for each block, there are A blue balls, plus potentially some reamining slots to fill the remaining space of N
    remaining_slots = N % (A+B)
    if A <= remaining_slots:
        # if it can fit A, place A more balls in the row
        print(blocks*A + A) 
    else:
        print(blocks*A + remaining_slots)
else:
    if A < N:
        print(A)
    else:
        print(N)

Buggy submission (verdict: Runtime Error):
    # N: number of balls to take, A: blue, B: red
    N, A, B = list(map(int, input().split()))

    if N == 0:
        print(0)

    if A + B < N:
        # want to know how much A + B blocks can we place such that A + B < N (i.e. solve x(A+B) < N)
        blocks = int(N/(A+B))
        # for each block, there are A blue balls, plus potentially some reamining slots to fill the remaining space of N
        remaining_slots = N % (A+B)
        if A <= remaining_slots:
            # if it can fit A, place A more balls in the row
            print(blocks*A + A) 
        else:
            print(blocks*A + remaining_slots)
    else:
        if A + B == N:
            print(A)
        else:
            print(A-N)
Problem p02753 (python)

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

Buggy submission (verdict: Runtime Error):
N,B,R=map(int,input().split())
b=0
total=0

for i in range(10**100):
    total+=B
    b+=1
    if total>N:
        break
    total+=R
    if total>N:
        break
if B==0:
    print(0)

else:
    print(B*b-(total-N))

Buggy submission (verdict: Runtime Error):
a=input()
if a[1]==a[2]==a[3]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a=input()
if a[1]==a[2]==a[3]
  print("No")
else:
  print("Yes")
Problem p02754 (python)

Fixed submission:
N,B,R=map(int,input().split())
b=0
i=int(N/(B+R))
tari=N-(i*(B+R))

b+=B*i
if tari >= B:
    b+=B
else:
    b+=tari

print(b)

Buggy submission (verdict: Runtime Error):
for i in range(10**100):
    total+=B
    b+=1
    if total>N:
        break
    total+=R
    if total>N:
        break
if B==0:
    print(0)

else:
    print(B*b-(total-N))
Problem p02759 (python)

Fixed submission:
import math 
n=int(input())
print(math.ceil(n/2))

Buggy submission (verdict: Runtime Error):
import math 
n=int(input())
print(math.ceil(n/2)
Problem p02829 (python)

Fixed submission:
a=input()
b=input()
Lis=["1","2","3"]
for i in range(3):
  if a!=Lis[i] and b!=Lis[i]:
    print(Lis[i])

Buggy submission (verdict: Runtime Error):
a,b=input().split()
Lis=["1","2","3"]
for i in range(3):
  if a!=Lis[i] and b!=Lis[i]:
    print(Lis[i])
Problem p03041 (python)

Fixed submission:
Big=["A","B","C"]
Small=["a","b","c"]

N,K=map(int,input().split())
S=list(input())

for i in range(3):
  if S[K-1]==Big[i]:
    S[K-1]=Small[i]

print("".join(S))

Buggy submission (verdict: Runtime Error):
Big=["A","B","c"]
Small=["a","b","c"]

N,K=map(int,input().split())
S=list(input())

for i in range(3):
  if S[K]==Big[i]:
    S[K]=Small[i]

print("".join(S))
Problem p02897 (python)

Fixed submission:
n=int(input())
if n%2==1:
  ans=(n+1)/(2*n)
else:
  ans=0.5
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2==1:
  ans=(n+1)/(2*n)
else:
  ans=0.5
printa(ans)
Problem p02699 (python)

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

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

Buggy submission (verdict: Runtime Error):
s=input()
w=input()
if(s<w) 
  print("unsafe")
else
  print("safe")
Problem p02699 (python)

Fixed submission:
S,W=map(int, input().split())
print("safe" if S>W else "unsafe")

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int, input().split())
while True:
	b -= c
	if c<=0:
      print"Yes"
      break
	a -=d
	if a<=0:
      print"No"
      break
Problem p02711 (python)

Fixed submission:
s = str(input())
if s[0] is "7":
  print("Yes")
elif s[1] is "7":
  print("Yes")
elif s[2] is "7":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = "input()"
if s[0] = 7:
  print("Yes")
elif s[1] = 7:
  print("Yes")
elif s[2] = 7:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = "input()"
if s[0] = 7:
  print(Yes)
elif s[1] = 7:
  print(Yes)
elif s[2] = 7:
  print(Yes)
else:
  print(No)

Buggy submission (verdict: Runtime Error):
s = str(input())
if s[0] = 7:
  print(Yes)
elif s[1] = 7:
  print(Yes)
elif s[2] = 7:
  print(Yes)
else:
  print(No)

Buggy submission (verdict: Runtime Error):
s = input()
if s[0] = 7:
  print(Yes)
elif s[1] = 7:
  print(Yes)
elif s[2] = 7:
  print(Yes)
else:
  print(No)

Buggy submission (verdict: Runtime Error):
s = input()
if s in 7:
  print(Yes)
  else:
    print(No)
Problem p02723 (python)

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

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

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

Fixed submission:
n,m = map(int,input().split())
print(int(n*(n-1)/2 + m*(m-1)/2))

Buggy submission (verdict: Runtime Error):
import math
n,m = map(int,input().split())
if n is 0 or n is 1:
  print(math.factorial(m)/math.factorial(m-2)/2)
if m is 0 or m is 1:
  print(math.factorial(n)/math.factorial(n-2)/2)
else:
  print(math.factorial(n+m)/math.factorial(n+m-2)/2)

Buggy submission (verdict: Runtime Error):
n = input()
m = input()
print(math.factorial(n+m))

Buggy submission (verdict: Runtime Error):
n = input()
m = input()
if n=0 or n=1:
  print(math.factorial(m))
if m=0 or m=1:
  print(math.factorial(n))
else:
  print(math.factorial(n+m))
Problem p02753 (python)

Fixed submission:
s = str(input())
if s == "AAA":
  print("No")
elif s == "BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s = str(input())
if s="AAA" or s="BBB":
  print("No")
else:
  print("No")
Problem p02759 (python)

Fixed submission:
s = int(input())
print(s//2 + s%2)

Buggy submission (verdict: Runtime Error):
s = input()
print(s//2 + s%2)
Problem p02771 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a = b and not a = b = c:
  print("Yes")
elif b = c and not a = b = c:
  print("Yes")
elif c = a and not a = b = c:
  print("Yes")
else:
  print("No")
Problem p03329 (python)

Fixed submission:
n=int(input())
s=[i for i in range(n+1)]
a=[1,6,9,36,81,216,729,1296,6561,7776,46656,59049]
for i in range(n+1):
    s[i]=i
for i in range(1,12):
    if a[i]<=n :
        k=a[i]
        for j in range(k,n+1):
            if s[j]>s[j-k]+1:
                s[j]=s[j-k]+1
print(s[n])

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
s=np.zeros(100001,dtype='int32')
a=[1,6,9,36,81,216,729,1296,6561,7776,46656,59049]

for i in range(n+1):
    s[i]=i
for i in range(1,12):
    if a[i]<=n :
        for j in range(a[i],n+1):
            if s[j]>s[j-a[i]]+1:
                s[j]=s[j-a[i]]+1
print(s[n])

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
s=np.zeros(100001,dtype='int32')
a=[1,6,9,36,81,216,729,1296,6561,7776,46656,59049]

for i in range(n+1):
    s[i]=i
for i in range(1,12):
    if a[i]<=n :
        for j in range(a[i],n+1):
            if s[j]>s[j-a[i]]+1:
                s[j]=s[j-a[i]]+1
print(s[n])