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

Fixed submission:
import sys
from itertools import accumulate

def read():
    return sys.stdin.readline().rstrip()

def main():
    n = 10**5
    p = [i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and i % 7 != 0 for i in range(n + 1)]
    p[1] = False
    p[2] = p[3] = p[5] = p[7] = True
    for pi in range(3, int(n ** 0.5) + 1, 2):
        if not p[pi]:
            continue
        for i in range(pi ** 2, n + 1, pi):
            p[i] = False
    like = [i % 2 == 1 and p[i] and p[(i + 1) // 2] for i in range(n)]
    a = [0] + list(accumulate(like))[1:]
    for _ in range(int(read())):
        l, r = map(int, read().split())
        print(a[r] - a[l - 1])

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from itertools import accumulate

def read():
    return sys.stdin.readline().rstrip()

def main():
    n = 10**5
    p = [i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and i % 7 != 0 for i in range(n + 1)]
    p[1] = False
    p[2] = p[3] = p[5] = p[7] = True
    for pi in range(3, int(n ** 0.5) + 1, 2):
        if not p[pi]:
            continue
        for i in range(pi ** 2, n + 1, pi):
            p[i] = False
    like = [i % 2 == 1 and p[i] and p[(i + 1) // 2] for i in range(n)]
    a = list(accumulate(like[1:], initial=0))
    for _ in range(int(read())):
        l, r = map(int, read().split())
        print(a[r] - a[l - 1])

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

Fixed submission:
input()
s = input()
d = 0
x = 0
for c in s:
    if c == "(":
        d += 1
    else:
        d -= 1
    x = min(d, x)
print("(" * -x + s + ")" * (d - x))

Buggy submission (verdict: Runtime Error):
n = int(input())
    s = input()
    d = 0
    x = n
    for si in s:
        if si == "(":
            d += 1
        else:
            d -= 1
        x = min(d, x)
    print("(" * -x + s + ")" * (d - x))
Problem p03846 (python)

Fixed submission:
n=int(input());print([0,2**(n//2)%(10**9+7)][sorted(map(int,input().split()))==[(i+n%2)//2*2+1-n%2for i in range(n)]])

Buggy submission (verdict: Runtime Error):
n=int(input());print([0,pow(2,(n//2),(10**9+7))][sorted(map(int,input().split()))==[i+(i+N+1)%2for i in range(N)]])
Problem p03997 (python)

Fixed submission:
a,b,h=map(int,open(0));print((a+b)*h//2)

Buggy submission (verdict: Runtime Error):
a,b,h=map(int,input().split());print((a+b)*h//2)
Problem p02536 (python)

Fixed submission:
def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
#import numpy as np
import sys
import math
import collections
par = []
def init(n):
    for i in range(n):
        par.append(i)

def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]

def same(x,y):
    if root(x) == root(y):
        return True
    else:
        return False

def unite(x,y):
    x = root(x)
    y = root(y)
    if x==y:
        return
    par[y] = x
n,m = L()
ab = NL(m)
init(n)
#print(ab)
#print(par)
for a,b in ab:
    unite(a-1,b-1)
    #print(par)

for i in range(len(par)):
    root(i)
#print(par)
count = collections.Counter(par)
print(len(count)-1)

Buggy submission (verdict: Runtime Error):
def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
#import numpy as np
import sys
import math
import collections
par = []
def init(n):
    for i in range(n):
        par.append(i)

def root(x):
    if par[x] == x:
        return x
    else:
        par[x] = root(par[x])
        return par[x]

def same(x,y):
    if root(x) == root(y):
        return True
    else:
        return False

def unite(x,y):
    x = root(x)
    y = root(y)
    if x==y:
        return
    par[x] = y
n,m = L()
ab = NL(m)
init(n)
#print(ab)
#print(par)
for a,b in ab:
    unite(a,b)
#print(par)
count = collections.Counter(par)
print(len(count)-1)
Problem p02555 (python)

Fixed submission:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
import numpy
n = inN()

if n < 3:
    print(0)
    exit()
elif n < 6:
    print(1)
    exit()


m = n//3
n -= 5
l = [1]*n
ans = 1
for i in range(m-1):
    l = numpy.cumsum(l)
    l %= mod
    ans += l[n-1]%mod
    n -= 3

print(ans%mod)

Buggy submission (verdict: Runtime Error):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
import numpy
n = inN()

if n < 3:
    print(0)
    exit()
elif n < 6:
    print(1)
    exit()


m = n//3
n -= 5
l = [1]*n
ans = 1
for i in range(m-1):
    l = numpy.cumsum(l)
    l %= mod
    ans += l[n-1]%mod
    n -= 3

print(ans%mod)
Problem p02603 (python)

Fixed submission:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))

n = inN()
a = inL()

kab = 0
mon = 1000
f = []
i=0
state = 0
while(i < n-1):
    if state == 1:
        while(i<n-1):
            #print(a[i],a[i+1])
            if a[i+1]>=a[i]:
                f.append(0)
                i+=1
            else:
                f.append(2)
                #i+=1
                break
        state = 0
    elif state == 0:
        while(i<n-1):
            if a[i+1]<=a[i]:
                f.append(0)
                i +=1
            else:
                f.append(1)
                #i += 1
                state = 1
                break
    else:
        f.append(0)
    i += 1
f.append(2)
    
#print(f)   
for i in range(n):

    if f[i] == 1 :
        kab += mon//a[i]
        mon = mon % a[i]
    elif f[i] == 2:
        mon += a[i]*kab
        kab = 0
    
print(mon)

Buggy submission (verdict: Runtime Error):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))

n = inN()
a = inL()

kab = 0
mon = 1000
f = []
i=0
state = 0
while(i < n-1):
    if i == 0:
        if a[i+1] > a[i]:
            f.append(1)
            state = 1
        else:
            f.append(0)
    elif state == 1:
        while(i<n-1 and a[i+1]>=a[i]):
            f.append(0)
            i+=1
        f.append(2)
        state = 0
    elif state == 0:
        while(i<n-1):
            if a[i+1]<=a[i]:
                f.append(0)
                i +=1
            else:
                f.append(1)
                i += 1
                state = 1
                break
    else:
        f.append(0)
    i += 1
f.append(2)
    
print(f)   
for i in range(n):

    if f[i] == 1 :
        kab += mon//a[i]
        mon = mon % a[i]
    elif f[i] == 2:
        mon += a[i]*kab
        kab = 0
    
print(mon)

Buggy submission (verdict: Runtime Error):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))

n = inN()
a = inL()

kab = 0
mon = 1000
f = []
i=0
state = 0
while(i < n-1):
    if i == 0:
        if a[i+1] > a[i]:
            f.append(1)
            state = 1
        else:
            f.append(0)
    elif state == 1:
        while(i<n-1 and a[i+1]>=a[i]):
            f.append(0)
            i+=1
        f.append(2)
        state = 0
    elif state == 0:
        while(i<n-1):
            if a[i+1]<=a[i]:
                f.append(0)
                i +=1
            else:
                f.append(1)
                i += 1
                break
    else:
        f.append(0)
    i += 1
f.append(2)
    
print(f)   
for i in range(n):

    if f[i] == 1 :
        kab += mon//a[i]
        mon = mon % a[i]
    elif f[i] == 2:
        mon += a[i]*kab
        kab = 0
    
print(mon)
Problem p02621 (python)

Fixed submission:
def main():
    a = int(input())
    print(a + pow(a,2) + pow(a,3))

main()

Buggy submission (verdict: Runtime Error):
def main():
    import sympy
    n = int(input())
    s = 0
    
    for i in range(1,n+1):
        s += i * len(sympy.divisors(i))
    print(s)

main()
Problem p02657 (python)

Fixed submission:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))

a,b = inL()
print(a*b)

Buggy submission (verdict: Runtime Error):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
n = inN()
a = inL()
if 0 in a:
    print(0)
    exit()

sum = 1
for i in range(n):
    sum *= a[i]
    if sum <= pow(10,18):
        print(-1)
        exit()
print(sum)
Problem p02678 (python)

Fixed submission:
from collections import deque
import sys
n,m = map(int,input().split())
 
turo = [[] for i in range(n)]
q = deque()
his = [False]*n
for i in range(m):
    a,b = map(int,input().split())
    turo[a-1].append(b-1)
    turo[b-1].append(a-1)
 
par = [i for i in range(n)]
rank = [sys.maxsize for i in range(n)]
rank[0] = 0
q.append(0)
 
while len(q) > 0:
    #print(q)
    room = q.popleft()
    
    if not his[room] :
        his[room] = True
    else:
        continue
    for room2 in turo[room]:
        if rank[room] < rank[room2]:
            q.append(room2)
            par[room2] = room
            rank[room2] = rank[room]+1
 
if len(his) < n:
    print("No")
    exit()
 
print("Yes")
for i in range(1,n):
    print(par[i]+1)

Buggy submission (verdict: Runtime Error):
from collections import deque
n,m = map(int,input().split())

turo = [[] for i in range(n)]
q = deque()
his = []

def root(x):
    if par[x] == x:
        return x
    else:
        return root(par[x])

for i in range(m):
    a,b = map(int,input().split())
    turo[a-1].append(b-1)
    turo[b-1].append(a-1)

par = [i for i in range(n)]
q.append(0)
his.append(0)

while len(q) > 0:
    #print(q)
    room = q.popleft()
    #print(room+1)
    for room2 in turo[room]:
        if room2 not in his:
            his.append(room2)
            q.append(room2)
            par[room2] = room

#print(turo,par)
for i in range(1,n):
    if (root(i) != 0):
        print("No")
        exit()
 
print("Yes")
for i in range(1,n):
    print(par[i]+1)

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque
par = []
rank = []
def init(n):
    for i in range(n):
        par.append(i)
        rank.append(sys.maxsize)
    rank[0] = 0
 
def root(x):
    if par[x] == x:
        return x
    else:
        return root(par[x])
        
 
def same(x,y):
    if root(x) == root(y):
        return True
    else:
        return False
 
def unite(x,y):
    #print(par[x],par[y],rank[root(x)],rank[root(y)])
    if par[x]==par[y]:
        return
    if rank[x] != sys.maxsize and rank[x] == rank[y]:
        pass
    elif(rank[x] < rank[y]):
        par[y] = x
        rank[y] = rank[x] + 1
    else:
        par[x] = y
        rank[x] = rank[y] + 1
        #if rank[x]==rank[y]:
         #   rank[x] += 1
    #print(par,rank)
 
n,m = map(int,input().split())

turo = [[] for i in range(n)]
q = deque()
his = []

for i in range(m):
    a,b = map(int,input().split())
    turo[a-1].append(b-1)
    turo[b-1].append(a-1)

init(n)
q.append(0)
his.append(0)

while len(q) > 0:
    #print(q)
    room = q.popleft()
    #print(room+1)
    for room2 in turo[room]:
        if room2 not in his:
            his.append(room2)
            q.append(room2)
            unite(room,room2)

print(turo,par)
for i in range(1,n):
    if (root(i) != 0):
        print("No")
        exit()
 
print("Yes")
for i in range(1,n):
    print(par[i]+1)
Problem p02696 (python)

Fixed submission:
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]

a,b,n = inL()

x = min(b-1,n)
print(int(a*x/b)-a*int(x/b))

Buggy submission (verdict: Runtime Error):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]

a,b,n = inL()

i = 0

l = [0]*(b+1)
for i in range(1,min(b,n)+1):
    l[i] = int(a*i/b)-a*int(i/b)


print(max(l))

Buggy submission (verdict: Runtime Error):
def inN():
    return int(input())
def inL():
    return list(map(int,input().split()))
def inNL(n):
    return [list(map(int,input().split())) for i in range(n)]

a,b,n = inL()

i = 0

l = [0]*b
for i in range(1,min(b,n)+1):
    l[i] = int(a*i/b)-a*int(i/b)
    #if (q <= p):
        #break

print(max(l))
Problem p03161 (python)

Fixed submission:
import sys
n,k = map(int,input().split())
a = list(map(int,input().split()))
cost = [0] * n
cost[1] = abs(a[1]-a[0])
mi = sys.maxsize
for i in range(1,n):
    for j in range(max(0,i-k),i):
        mi = min(mi,cost[j]+abs(a[i]-a[j]))
        #print(j,mi)
    
    cost[i] = mi
    mi = sys.maxsize
#print(cost)
print(cost[n-1])

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))
cost = [0] * n
cost[1] = abs(a[1]-a[0])
mi = 999999
for i in range(1,n):
    for j in range(max(0,i-k),i):
        #print(j,mi)
        mi = min(mi,cost[j]+abs(a[i]-a[j]))
    cost[i] = mi
    mi = 999999
#print(cost)
print(cost[n])
Problem p03162 (python)

Fixed submission:
class Data:
    def __init__(self,n):
        self.n = n
        self.abc = []
        self.dp = [[0,0,0]]

    def input_abc(self):
        for i in range(self.n):
            self.abc.append(list(map(int,input().split())))
    
    def chmax(self,i,j,k):
        a = self.dp[i-1][j] + self.abc[i-1][k]
        b = self.dp[i][k]
        if (a>b):
            self.dp[i][k] = a
        #print("j",j,"k",k,a,b,"\n",self.dp)
def main():
    n = int(input())
    data = Data(n)
    data.input_abc()
    for i in range(1,n+1):
        data.dp.append([0,0,0])
        for j in range(3):
            for k in range(3):
                if j != k:
                    data.chmax(i,j,k)
    print(max(data.dp[i]))

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
class Data:
    def __init__(self,n):
        self.n = n
        self.abc = []
        self.sum = 0
        self.history = [-1]*n
        self.ava = [[1,2],[0,2],[0,1]]

    def change_his(self,i):
        a = self.abc[i-1][self.history[i]] + max(self.abc[i][self.ava[self.history[i]][0]],self.abc[i][self.ava[self.history[i]][1]])
        b = max(self.abc[i-1][self.ava[self.history[i]][0]],self.abc[i-1][self.ava[self.history[i]][1]]) + self.abc[i][self.history[i]]
        if a>b:
            self.history[i] = self.abc[i].index( max(self.abc[i][self.ava[self.history[i]][0]],self.abc[i][self.ava[self.history[i]][1]]))
            
        elif a==b:
            self.history[i] = self.abc[i].index( max(self.abc[i][self.ava[self.history[i]][0]],self.abc[i][self.ava[self.history[i]][1]]))
        else:
            self.history[i-1] = self.abc[i].index(max(self.abc[i-1][self.ava[self.history[i]][0]],self.abc[i-1][self.ava[self.history[i]][1]]))
            if(self.history[i-1]==self.history[i-2]):
                self.change_his(i-1)
        return

    def input_abc(self):
        for i in range(self.n):
            self.abc.append(list(map(int,input().split())))

    def init(self):
        #print(self.abc)
        self.history[0] = self.abc[0].index(max(self.abc[0]))
    
    def count(self):
        for i in range(self.n):
            self.sum += self.abc[i][self.history[i]]

def main():
    n = int(input())
    data = Data(n)
    data.input_abc()
    data.init()
    for i in range(1,n):
        data.history[i] = data.abc[i].index(max(data.abc[i]))
        if(data.history[i-1] == data.history[i]):
            data.change_his(i)
    data.count()
    print(data.sum)

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

Fixed submission:
import sys
n,k = map(int,input().split())
x = list(map(int,input().split()))

mi = sys.maxsize

for i in range(n-k+1):
    l = x[i]
    r = x[i+k-1]
    #print(l,r)
    vall = abs(l) + abs(r - l)
    valr = abs(r) + abs(r - l)
    mi = min(mi,min(vall,valr))

print(mi)

Buggy submission (verdict: Runtime Error):
def val(lst):
    m = list([lst[i] for i in range(len(lst)) if lst[i] < 0])
    p = list([lst[i] for i in range(len(lst)) if lst[i] >= 0])
    if (len(m) == 0):
        return max(p)
    elif(len(p) == 0):
        return abs(min(m))
    elif abs(min(m)) > max(p):
        return abs(min(m))+max(p)*2
    else:
        return abs(min(m))*2 + max(p)

n,k = map(int,input().split())
x = list(map(int,input().split()))
sa = n-k
p = 0
for i in range(len(x)):
    if x[i] >= 0:
        p = i
        break

start = 0
if p-k > 0:
    start = p-k
    
end = p+1
if end+k > len(x):
    end = len(x)-k+1

value = []
for i in range(start,end):
    lst = x[i:i-sa if i-sa <= 0 else None]
    print(i,":",i-sa)
    print(lst)
    value.append(val(lst))
print(min(value))
Problem p03284 (python)

Fixed submission:
n,k = map(int,input().split())
print(-(-(n%k) // k))

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

if n%7 == 0:
    print("Yes")
    f = False

while(n > 0)and(f):
    if(n%4 == 0):
        print("Yes")
        f = False
    n -= 7
if(f):
    print("No")
Problem p03294 (python)

Fixed submission:
from functools import reduce
from fractions import gcd

n = input()
a = list(map(int,input().split()))
gd = reduce(gcd,a)
m = reduce(lambda a,b: a*b,a)//gd -1
sum = sum(map(lambda x: m%x,a))

print(int(sum))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
n = input()
a = list(map(int,input().split()))
gd = reduce(gcd,a)
m = reduce(lambda a,b: a*b,a)/gd -1
sum = sum(map(lambda x: m%x,a))

print(int(sum))

Buggy submission (verdict: Runtime Error):
from numpy import array,lcm
n = input()
a = array([int(e) for e in input().split()])
m = lcm.reduce(a) - 1
sum = 0

for i in range(len(a)):
    sum += m%a[i]

print(sum)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = input()
a = np.array([int(e) for e in input().split()])
m = np.lcm.reduce(a) - 1
sum = 0

for i in range(len(a)):
    sum += m%a[i]
print(sum)
Problem p03324 (python)

Fixed submission:
nums = [int(e) for e in input().split()]
if(nums[1] == 100):
    print(pow(100,nums[0])*(nums[1]+1))
else:
    print(pow(100,nums[0])*nums[1])

Buggy submission (verdict: Runtime Error):
nums = [int(e) for e in input().split()]
if(num[1] == 100):
    print(pow(100,nums[0])*(nums[1]+1))
else:
    print(pow(100,nums[0])*nums[1])
Problem p03471 (python)

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

satu = [1000,5000,10000]

sen = [1000 * i for i in range(n+1)]
gsen = [5000 * i for i in range(n+1)]
man = [10000 * i for i in range(n+1)]

#print(sen,gsen,man)
for i in range(n+1):
    for j in range(n+1-i):
        if man[i]+ gsen[j] + sen[n-i-j] == y:
            print(i,j,n-i-j)
            exit()

print("-1 -1 -1")

Buggy submission (verdict: Runtime Error):
import numpy as np
N,Y = map(int,input().split())
satu = np.array([10000,5000,1000])
lst = []
flag = True
for i in range(N+1):
    for j in range(N+1):
        if(N-i-j)>=0:
            lst.append(np.array([i,j,N-i-j]))
for i in range(len(lst)):
    gaku = np.dot(satu,lst[i])
    if gaku == Y:
        print(lst[i][0],lst[i][1],lst[i][2])
        #print("{} {} {}".format(lst[i]))
        flag = False
        break
if flag:
    print("-1 -1 -1")
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m=map(int,input().split())

if 30*h+m/2-6*m>=0:
  x=30*h+m/2-6*m
else:
  x=6*m-30*h-m/2
  
print((a**2+b**2-2*a*b*math.cos(math.radians(x)))**(1/2))

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

if 30*h+m/2-6*m>=0:
  x=30*h+m/2-6*m
else:
  x=6*m-30*h-m/2
  
print((a^2+b^2-2*a*b*math.cos(x))**(1/2))
Problem p02717 (python)

Fixed submission:
X,Y,Z=map(int,input().split())
print(Z,X,Y)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
a = list(map(int, input().split()))
list.sort(a, reverse=True)

if a[M-1] < sum(a)/(4*M) :
  print("No")
else:
  print("Yes")
Problem p02724 (python)

Fixed submission:
X=int(input())
A=int(X/500)
B=int((X-A*500)/5)
print(A*1000+B*5)

Buggy submission (verdict: Runtime Error):
X=int(input())
A=math.floor(X/500)
B=math.floor((X-A*500)/5)
print(A*1000+B*5)
Problem p02730 (python)

Fixed submission:
s=input()
n=len(s)
p=n//2
t=1

for i in range(p):
    if s[i]==s[p-1-i]:
        t=1
    else:
        t=0
        break;

x=1

for i in range(p):
    if s[p+1+i]==s[n-1-i]:
        x=1
    else:
       x=0
       break

y=1

for i in range(n):
    if s[i]==s[n-1-i]:
        y=1
    else:
       y=0
       break

if (t==1 and x==1 and y==1):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
p=n//2
t=1

for i in range(p):
    if s[i]==s[p-1-i]:
        t=1
    else:
        t=0
        break;

x=1

for i in range(p):
    if s[p+1+i]==s[n-1-i]:
        x=1
   else:
       x=0
       break

y=1

for i in range(n):
    if s[i]==s[n-1-i]:
        y=1
   else:
       y=0
       break

if (t==1 and x==1 and y==1):
    print('Yes')
else:
    print('No')
Problem p02778 (python)

Fixed submission:
s=input()
a=""

l=len(s)

for i in range (l):
  a=a+"x"
print(a)

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

l=len(s)

for i in range(l):
  s[i]="x"
  
  
print(s)

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

l=len(s)

for i in range(l):
  s[i]=x
  
  
print(s)
Problem p02784 (python)

Fixed submission:
h,n=map(int,input().split())
a=list(map(int,input().split()))
sum=0
for i in a:
  sum=sum+i
  
if sum >=h:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=list(map(int,input().spliy()))
sum=0
for i in n:
  sum=sum+a[i]
  
if sum >=h:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=list(map(int,input().spliy()))
sum=0
for i in a:
  sum=sum+i
  
if sum >=h:
  print('Yes')
else:
  print('No')
Problem p02789 (python)

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

if n==m:
  print("Yes")
else:
  print("No")

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

if int(a)>=int(b):
  print(str(a)*b)
else:
  print(str(b)*a)
Problem p02818 (python)

Fixed submission:
a, b, k = map(int,input().split())
if k >= a + b:
  print("0 0")
elif k>a:
  print ("0 "+str(a+b-k))
else:
  print(str(a-k)+" "+str(b))

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

i=o
while i<k:
  if a>0:
    a=a-1
    i=i+1
  elif b>0:
    b=b-1
    i=i+1
print(a,b)
Problem p02887 (python)

Fixed submission:
n = int(input())
s = input()
count = 1
for i in range(n-1):
  if s[i+1]  != s[i]:
    count = count + 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input
count = 0
for i in range(n-1):
  if s[i]  != s[i+1];
    count = count + 1
print(count)
Problem p02969 (python)

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

Buggy submission (verdict: Runtime Error):
r=map(int,input().split())
print(3r**2)

Buggy submission (verdict: Runtime Error):
r=map(int,input().split)
print(3r**2)
Problem p02993 (python)

Fixed submission:
s=input()

if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')

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

if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print('Bad')
else:
  print('Good')
Problem p03101 (python)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())

print(H*W-h*W-H*w+h*w)

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().solit())
h,w=map(int,input().split())

print(h*W+H*w-h*w)