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

Fixed submission:
import collections
import heapq
n, m = map(int, input().split())
c = collections.defaultdict(list)
for i in range(n):
    a, b = map(int, input().split())
    if a > m:
        continue
    c[m - a].append(b)
h = []
heapq.heapify(h)    
ans = 0
for i in range(m - 1, -1, -1):
    for b in c[i]:
        heapq.heappush(h, -b)
    if len(h) >0:
        ans += -1 * heapq.heappop(h)
print(ans)

Buggy submission (verdict: Runtime Error):
import copy
n, m = map(int, input().split())
ab_lis = []
for i in range(n):
    ab_lis.append(list(map(int, input().split())))
def rec(ab_lis, path, rew, r_day, m_ans):
    if r_day == 0:
        m_ans[0] = max(m_ans[0], rew)
        return
    for t_lis in ab_lis:
        if t_lis in path:
            continue
        elif t_lis[0] > r_day:
            m_ans[0] = max(m_ans[0], rew)
            continue
        path_c = copy.copy(path)
        path_c.append(t_lis)
        rec(ab_lis, path_c, rew + t_lis[1], r_day - 1, ans)    
m_ans = [0]
rec(ab_lis, [], 0, m, m_ans)        
print(m_ans[0])
Problem p03286 (python)

Fixed submission:
n = int(input())
if n == 0:
    print(0)
    exit()
ans = ""
while n != 0:
    if n % (2) == 0:
        n = n // (-2)
        ans = "0" + ans
    else:
        n = (n - 1) // (-2)
        ans = "1" + ans
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n == 0:
    print(0)
    exit()
ans = ""
while n != 0:
    if n % (2) == 0:
        n = n // (-2)
        ans = ans + 0
    else:
        n = (n - 1) // (-2)
        ans = ans + 1
print(ans)
Problem p02711 (python)

Fixed submission:
a = input()
if '7' in a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = int(input())
for  _ in range(3):
  if a % 10 == 7:
    print("Yes")
   	break
  a /= 10
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
for  _ in range(3):
  if a % 10 == 7:
    print("Yes")
    return
  a /= 10
print("No")
return
Problem p02873 (python)

Fixed submission:
s = input()

index = 0
thanS = s[0]
count = 1
a = []
for i in range(1, len(s)):
    if thanS == s[i]:
        count += 1

    else:
        a.append(s[index: index + count])
        thanS = s[i]
        index = index + count
        count = 1

a.append(s[index:])
b = 0
add = 0

for i in range(len(a)):
    diff = len(a[i])
    if a[i][0] == "<":
        add += diff * (diff + 1) / 2
        b = diff
    else:
        if b < diff:
            add = add + diff * (diff + 1) / 2 - b
        else:
            add = add + (diff - 1) * diff / 2
        b = 0

print(int(add))

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

a = []
index = 0
diff = 0
for i in range(len(s) - 1):
    if s[i] == "<":
        a.appned(a[-1] + 1)
        index += 1

    else:
        if s[i + 1] == "<":
            diff = index - i

            if a[-1] <= diff:
                a[-1] = diff

            a = a + [diff - 1 - i for i in range(diff)]
            index += count
            count = 0
        else:
            count += 1

if count != 0:
    diff = index - len(s) + 1
    if a[-1] <= diff:
        a[-1] = diff

    a = a + [diff - 1 - i for i in range(diff)]

print(sum(a))
Problem p02753 (python)

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

Buggy submission (verdict: Runtime Error):
s=raw_input().split()
if s[0]==s[1] and s[0]!=s[2]:
  print "Yes"
elif s[0]==s[2] and s[0]!=s[1]:
  print "Yes"
elif s[1]==s[2] and s[1]!=s[0]:
  print "Yes"
elif s[1]==s[0] and s[1]!= s[2]:
  print "Yes"
elif s[2]==s[0] and s[2]!= s[1]:
  print "Yes"
elif s[2]==s[1] and s[2]!= s[0]:
  print "Yes"
else:
  print "No"
Problem p02829 (python)

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

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
if a=1 and b=2:
  print "3"
elif a=2 and b=3:
  print "1"
elif a=3 and b=1:
  print "2" 
elif a=3 and b=2:
  print "1"
elif a=2 and b=1:
  print "3"
else:
  print "2"

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
s=["1","2","3"]
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
s=["1","2","3"]
s.remove(x)
s.remove(y)
print s[0

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
s=1,2,3
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
s="1","2","3"
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
a,b=raw_input().split()
s=["1","2","3"]
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
a,b=raw_input().split()
s=[1,2,3]
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
s=[1,2,3]
a,b=raw_input().split()
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
s=[1,2,3]
a,b=map(int,raw_input().split())
s.remove(x)
s.remove(y)
print s[0]

Buggy submission (verdict: Runtime Error):
s=[1,2,3]
a,b=raw_input.split()
s.remove(x)
s.remove(y)
print s[0]
Problem p02847 (python)

Fixed submission:
a= ["MON","TUE","WED","THU","FRI","SAT","SUN"]
s=raw_input()
idNum=a.index(s)
if idNum == 6:
  print 7
else:
  print 6- idNum

Buggy submission (verdict: Runtime Error):
a= ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
s=raw_input()
idNum=a.index(s)
if idNum == 6:
  print 7
else:
  print 6- idNum
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print0.5
else:
  print (n+1)*1.0/2/n
Problem p03075 (python)

Fixed submission:
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
if e-a<=k:
  print "Yay!"
else:
  print ":("

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
d=input()
e=input()
k=input()
if e-a <=k:
  print Yay!
else:
  print :(
Problem p03242 (python)

Fixed submission:
x=input()
print 1110-x

Buggy submission (verdict: Runtime Error):
x=raw_input()
print 1110-x
Problem p03250 (python)

Fixed submission:
A,B,C = map(int,raw_input().split())
max_num=A
if max_num < B:
    max_num = B
if max_num < C:
    max_num= C
print max_num*9+(A+B+C)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,raw_input().split())
max_num=a
if max_num < b
    max_num=b
if max_num < c
    max_num=c
print max_num*9+(a+b+c)
Problem p03272 (python)

Fixed submission:
N,j= map(int,raw_input().split())
print N-j+1

Buggy submission (verdict: Runtime Error):
N=input()
j=input()
print N-j+1
Problem p02935 (python)

Fixed submission:
##C problem
N = int(input())
v = list(map(float, input().split()))

vs = sorted(v)

for i in range(N-1):

    a=vs[0]

    b=vs[1]
    c=(a+b)/2
    vs.remove(b)
    vs.insert(0,c)
    vs.remove(a)
    #print(i)
    #print(vs)

print(vs[0])

Buggy submission (verdict: Runtime Error):
##C problem
N = int(input())
v = list(map(float, input().split()))
##初期処理
a=min(v)
##最初に出てくる指定した要素を削除
#v.remove(a)
#v.remove(b)
#v.append( (a+b)/2 )

for i in range(N-1):
        a=v[-1]
        remove(a)
        b=min(v)
        v.remove(b)
        v.append((a+b)/2)

Buggy submission (verdict: Runtime Error):
##C problem
N = int(input())
v = list(map(float, input().split()))
##初期処理
a=min(v)
##最初に出てくる指定した要素を削除
v.remove(a)
b=min(v)
v.remove(b)
v.append( (a+b)/2 )

for i in range(N-2):
        a=v[-1]
        remove(a)
        b=min(v)
        v.remove(b)
        v.append((a+b)/2)

print(v[-1])
Problem p02725 (python)

Fixed submission:
k, n = map(float, input().split())
m = list(map(float, input().split()))
half_k = k / 2
min = float(1000000)
for i in range(int(n)):
    first = m[i]
    last = m[i-1]
    len = last - first
    if len < 0:
        len = len + k
    if min > len:
        min = len
print(int(min))

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

a = int(X / 500)*1000 + int((X%500)/5)*5
print(a)
Problem p02779 (python)

Fixed submission:
n = int(input())
A = [int(e) for e in input().split()]

if len(set(A)) == len(A):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(e) for e in input().split()]

if length(set(A)) == length(A):
  print("YES")
else:
  print("NO")
Problem p02777 (python)

Fixed submission:
red,blue=input().split()
a,b=(int(x) for x in input().split())
dic={red:a,blue:b}
u=input()
dic[u]-=1
print(str(dic[red])+" "+str(dic[blue]))

Buggy submission (verdict: Runtime Error):
red,blue=input().split()
a,b=(int(x) for x in input().split())
dic={red:a,blue:b}
u=input()
dic[u]-=1
print(dic[a]+" "+dic[b])
Problem p02835 (python)

Fixed submission:
if __name__ == '__main__':
  line=[int(x) for x in input().split()]
  if(sum(line)>=22):
    print("bust")
  else:
    print("win")

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
  a,b,c=(int(x) for x in input().split())
  if(sum(a,b,c)>=22):
    print("bust")
  else:
    print("win")
Problem p02990 (python)

Fixed submission:
from math import factorial

mod=1000000000+7

def C(n,k):
    N=(factorial(n))
    K=(factorial(k))
    N_K=(factorial(n - k))
    return int( ( N // K // N_K )%mod )

n,k=list(map(int, input().split()))
blue=k
red=n-k
for i in range(1,blue+1):
    if i > red+1:
        print(0)
    else:
        print( (C(red+1,i)%mod)*(C(blue-1,i-1)%mod)%mod)

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

mod=1000000000+7

def C(n,k):
    N=(factorial(n))
    K=(factorial(k))
    N_K=(factorial(n - k))
    return int( ( N // K // N_K )%mod )

n,k=list(map(int, input().split()))
blue=k
red=n-k
for i in range(1,blue+1):
    print(C(red+1,i)*C(blue-1,i-1)%mod)
Problem p03012 (python)

Fixed submission:
# -*- coding: utf-8 -*-
length=int(input())
lst=list(map(int,input().split()))
lst2=[]
for i in range(length):
    s1=sum(lst[0:i+1])
    s2=sum(lst[i+1:])
    lst2.append(abs(s1-s2))
print(min(lst2))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
length=int(input())
lst=list(map(int,input().split()))
per_diff=0
s1=0
for i in range(length):
  s1=sum(lst[0:i+1])
  s2=sum(lst[i+1:])
  if math.abs(s1-s2)>pre_diff:
    print(pre_diff)
    break
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
C = []
for _ in range(M):
  C.append([int(i) for i in input().split()])
C.sort(key=lambda x: -x[1])
cur = 0
ans = 0
for a in A:
  if cur != len(C) and C[cur][0] == 0:
    cur += 1
  if cur != len(C) and a < C[cur][1]:
    ans += C[cur][1]
    C[cur][0] -= 1
  else:
    ans += a
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
C = []
for _ in range(M):
  C.append([int(i) for i in input().split()])
C.sort(key=lambda x: -x[1])
cur = 0
ans = 0
for a in A:
  if C[cur][0] == 0:
    cur += 1
  if cur == len(C):
    ans += a
    continue
  if a < C[cur][1]:
    ans += C[cur][1]
    C[cur][0] -= 1
  else:
    ans += a
print(ans)
Problem p03075 (python)

Fixed submission:
atn = [int(input()) for i in range(5)]
k = int(input())
b = 1
for i in range(4):
    for j in range(4 - i):
        if abs(atn[i] - atn[i + j + 1]) > k:
            b = 0

if b:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
import heapq

X, Y, Z, K = map(int, input().split())
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)

heap = []
heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))
added = set([(0, 0, 0)])
for _ in range(K):
    p, i, j, k = heapq.heappop(heap)
    if (i + 1, j, k) not in added and i + 1 < X:
        heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        added.add((i + 1, j, k))
    if (i, j + 1, k) not in added and j + 1 < Y:
        heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        added.add((i, j + 1, k))
    if (i, j, k + 1) not in added and k + 1 < Z:
        heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        added.add((i, j, k + 1))
    print(-p)
Problem p03250 (python)

Fixed submission:
a, b, c = sorted(map(int, input().split()))
print(a + b + c * 10)

Buggy submission (verdict: Runtime Error):
a, b, c = sorted(map(int, input()))
print(a + b + c * 10)
Problem p02711 (python)

Fixed submission:
s = input()
if '7' in s:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = list[map(int, input().split())]
a = s.count(7)
if a == 0:
  print('No')
else:
  print('Yes')
Problem p02723 (python)

Fixed submission:
s = 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[3] == s[4] and s[5] == s[6]:
  print('Yes')
else:
  print('No')

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

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

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
num = 2//n*(n-1) + 2//m*(m-1)
print(num)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
num = 2/n*(n-1) + 2/m*(m-1)
print(num)
Problem p02771 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a == b == c == a or a != b != c != a:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input())
if a == b == c or a != b != c:
  print('No')
else:
  print('Yes')
Problem p02711 (python)

Fixed submission:
a = int(input())
third = a // 100
second = a // 10 - third * 10
first = a - (third *100 +second*10)
if(third == 7 or second == 7 or first == 7):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a = input()
third = a % 100
second = a % 10 - thrid * 10
first = a - (third *100 +second*10)
if(third == 7 or second == 7 or first == 7):
  print("Yes")
else:
  print("No")
Problem p02711 (python)

Fixed submission:
N=list(map(int,input()))

if 7 in N:
  print("Yes")
else:
  print("No")

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

if 7 in N:
  print("Yes")
else:
  print("No")
Problem p02711 (python)

Fixed submission:
n = input()
if "7" in n:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = input()
return "7" in n
Problem p02712 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(1, n+1):
  if not (i % 3 == 0 or i % 5 == 0):
    sum += i
    
print(sum)

Buggy submission (verdict: Runtime Error):
n = int(inupt())
sum = 0
for i in range(1, n+1):
  if n % 3 == 0 or n % 5 == 0:
    sum += i
    
print(sum)
Problem p02711 (python)

Fixed submission:
n = input()
print('Yes') if '7' in n else print('No')

Buggy submission (verdict: Runtime Error):
c =0

N = int(input())+1
S = tuple(input())


for i in range(1,N):
    for j in range(1,N):
        if i > j:
                continue
        elif S[i-1] == S[j-1]:
                continue
        for k in range(1,N):
            if j > k:
                continue
            elif S[i-1] == S[k-1] or S[j-1] == S[k-1]:
                continue
            elif j - i == k - j:
                continue
            else:
                c += 1
print(c)

Buggy submission (verdict: Runtime Error):
c =0

N = int(input())+1
S = tuple(input())


for i in range(1,N):
    for j in range(1,N):
        if i > j:
                continue
        elif S[i-1] == S[j-1]:
                continue
        for k in range(1,N):
            if j > k:
                continue
            elif S[i-1] == S[k-1] or S[j-1] == S[k-1]:
                continue
            elif j - i == k - j:
                continue
            else:
                c += 1
print(c)
Problem p02729 (python)

Fixed submission:
N, M = map(int, input().split())

c = 0
c += (N*(N-1))/2
c += (M*(M-1))/2

print(int(c))

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

c = 0
c += N(N-2)/2
c += M(M-2)/2

print(c)

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

c = 0
c += N(N-2)/2
c += M(M-2)/2

print(c)
Problem p02753 (python)

Fixed submission:
s =input()

c = s.count('A')

if c == 3:
    print("No")
elif c == 0:
    print('No')
else: 
    print('Yes')

Buggy submission (verdict: Runtime Error):
s = map(int, input().sprit)

for i in range(len(s)):
    if s[i] in s:
        print('Yes')
        break
    else: 
        print('No')
Problem p02754 (python)

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

t = n//(a+b)
c=0

if t == 0 and n < a:
    c += n
    print(c)
elif t == 0 and n >= a:
    c += a
    print(c)
elif t > 0:
    c += t * a
    r = n%(a+b)
    if r == 0:
        print(c)
    elif r < a:
        c += r 
        print(c)
    elif r > a:
        c += a
        print(c)

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

t = n//(a+b)

if t == 0 and n < a:
    c += n
    print(c)
elif t == 0 and n >= a:
    c += a
    print(a)
elif t > 0:
    c += t * a
    r = n%(a+b)
    if r == 0:
        print(c)
    elif r < a:
        c += r 
        print(c)
    elif r > a:
        c += a
        print(c)
Problem p02759 (python)

Fixed submission:
n = int(input())

p = n//2 + n%2
print(p)

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

lis = []
for i in range(m):
    lis.append(list(map(int, input().split())))
    
ans = [0,0,0]
if n == 2:
    ans[1] = 1
elif n == 3:
    ans[0] = 1
    
k = 0
out = []

for i in lis:
    if i[0] not in out:
        ans[int(i[0]-1)] = int(i[1])
        out.append(i[0])
    elif i[0] in out and i[1] != ans[i[0]-1]:
        k += 1

inte = ans[0] * 100 + ans[1]*10 + ans[2]
    
    
if inte > 0 and k ==0:
    print(inte)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
f = list(map(int, input().split()))
s = list(map(int, input().split()))
t = list(map(int, input().split()))
n = int(input())
k = []
for i in range(n):
    k.append(int(input()))

lis = []

lis.append(f)
lis.append(s)
lis.append(t)

ans = 0

for i in lis:
    c =0
    for n in range(len(i)):
        if i[n] in k:
            i[n] = 'X'
            c += 1
            if c == 3:
                ans +=1
                break

if f[0] == 'X' and s[0] == 'X' and t[0] == 'X':
    ans +=1
elif f[1] == 'X' and s[1] == 'X' and t[1] == 'X':
    ans += 1
elif f[2] == 'X' and s[2] == 'X' and t[2] == 'X':
    ans += 1
elif f[0] == 'X' and s[1] == 'X' and t[3] == 'X':
    ans += 1
elif f[3] == 'X' and s[2] == 'X' and t[1] == 'X':
    ans += 1
    
if ans >= 1:
    print('Yes')
else:
    print('No')
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
word = map(str, input())

if word[2]==word[3] and word[4]==word[5]:
  print('Yes')
else:
  print('No')
Problem p02835 (python)

Fixed submission:
print('bust') if (sum(map(int, input().split()))) >= 22 else print('win')

Buggy submission (verdict: Runtime Error):
print('bust') if sum(input().split()) >= 22 else print('win')
Problem p02836 (python)

Fixed submission:
s = str(input())
 
length = len(s)
 
n = length//2
 
m = 0
 
for i in range(n):
  x = (i+1)*(-1)
  if s[i]!=s[x]:
    m += 1
print(m)

Buggy submission (verdict: Runtime Error):
s = str(input())
 
length = len(s)
 
n = length//2
 
m = 0
 
for i in range(n):
  x = (i+1)*(-1)
  if s[i]!=s[k]:
    m += 1
print(m)

Buggy submission (verdict: Runtime Error):
s = str(input())
 
length = len(s)
 
n = length//2
 
m = 0
 
for i in range(n):
  x = (i+1)*(-1)
  if s[i]==s[k]:
    m += 1
print(m)

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

length = len(s)

n = length//2

m = 0

for i in range(length):
  x = (i+1)*(-1)
  if s[i]==s[k]:
    m += 1
print(m)
Problem p02880 (python)

Fixed submission:
x = int(input())
 
k = 0
 
for i in range(1,10):
  for j in range (1,10):
    if x==i*j:
      k += k+1
      
print('No') if k==0 else print('Yes')

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

k = 0

for i in range(1,10):
  for j in range (1,10):
    if x==i*j:
      k += k+1
      
print('No') if k==0 else print('Yes')
Problem p02951 (python)

Fixed submission:
bottle1, water, bottle2 = map(int, input().split())
empty = bottle1 - water
if empty <= bottle2:
  print(bottle2 - empty)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
bottle1, water, bottle2 = map(int, input().split())
empty = bottle1 - water
if empty =< bottle2:
  print(bottle2 - empty)
else:
  print(0)
Problem p02711 (python)

Fixed submission:
if "7" in input():
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
ans = S.count("R")*S.count("G")*S.count("B")

for i in range(N):
  for j in range(i+1,N):
      k = 2*j-i
      if N>k and S[i] != S[j] and S[i] != S[k] and S[j] != S[k]:
          ans-=1
          
print(ans)
Problem p02723 (python)

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

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

dist = lst[-1]-lst[0]
for i in range(N-1):
    dist = min(dist, K-lst[i+1]+lst[i])
print(dist)
Problem p03775 (python)

Fixed submission:
import math
N = int(input())
m = int(math.sqrt(N))
a = 0
ans = 0
count = 1

for i in range(1, m+1):
    if N % i == 0:
        a = i

a = max(a, (N//a))

while True:
    if a >= 10:
        count += 1
        a = a// 10
    else:
        break
    
print(count)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
m = int(math.sqrt(N))
a = 0
ans = 0
count = 1

for i in range(m, 1, -1):
    if N % i == 0:
        a = i
        break

a = max(a, (N//a))

while True:
    if a >= 10:
        count += 1
        a = a// 10
    else:
        break
    
print(count)
Problem p02712 (python)

Fixed submission:
N = int(input())
sum = 0
for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
        sum += i

print(sum)

Buggy submission (verdict: Runtime Error):
N = input()
sum = 0
for i in range(1, N+1):
    if i % 3 != 0 and i % 5 != 0:
        sum += i

print(sum)
Problem p02711 (python)

Fixed submission:
n = input()
n = str(n)
count = 0
 
for i in n:
  if (i=='7'):
    count = 1
    break
    
if (count!=0):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
#include<stdio.h>

int main(){
  
  	int N, summ, i;
  	i = 1;
  	summ = 0;
  
  	scanf("%d", &N);
  
  	while(i <= N){
    	if (N%3==0||N%5==0){
        	summ = summ;
        }
      	else{
        	summ += i;
        }
      	i++;
    }
  
  	printf("%d", summ);
	return 0;
}

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

for i in n:
  if (i=='7'):
    count++
    break
    
if (count!=0):
	print("Yes")
else:
	print("No")