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

Fixed submission:
n,m,k = map(int,input().split())
a_list = list(map(int,input().split()))
b_list = list(map(int,input().split()))

from itertools import accumulate
sum_a_list = list(accumulate([0] + a_list))
sum_b_list = list(accumulate([0] + b_list))

ans = 0
b_idx = m
for a_idx in range(n+1):
    if sum_a_list[a_idx] > k:
        continue
 
    while sum_a_list[a_idx] + sum_b_list[b_idx] > k:
        b_idx -= 1
    
    ans = max(ans, a_idx + b_idx)
        
print(ans)

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

from itertools import accumulate
sum_a_list = list(accumulate([0] + a_list))
sum_b_list = list(accumulate([0] + b_list))

ans = 0
b_idx = 0
for a_idx in range(n+1):
    if sum_a_list[a_idx] > k:
        continue

    time_rest = k - sum_a_list[a_idx]
    b_idx = bisect.bisect_left(sum_b_list,time_rest)
    
    ans = max(ans, a_idx + b_idx)
        
print(ans)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(n):
    ans_list.append(a_list.index(i+1) + 1)
print(*ans_list)
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
aa = set(a)
if len(a) == len(aa):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
    print("NO")
Problem p02831 (python)

Fixed submission:
from fractions import gcd
a,b = map(int,input().split())
def lcm(x,y):
    return x*y//gcd(x,y)
print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b = map(int,input().split())
def lcm(x,y):
    return x*y//gcd(x,y)
print(lcm(a,b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b = map(int,input().split())
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))
Problem p02881 (python)

Fixed submission:
import math
n = int(input())

a,b = 1,n
for i in range(1,int(math.sqrt(n)+1)):
    if n%i == 0:
        q = n//i
        if abs(a-b) > abs(q-i):
            a,b = i,q

print((a-1) + (b-1))

Buggy submission (verdict: Runtime Error):
impot math
N = int(input())

array = []
for i in range(1,math.floor((N)**0.5)+1)
    if N // i == 0:
        num = N // i
        array.append(num)
l = len(array)
print(int(array[l]) + (N / int(array[l])))

Buggy submission (verdict: Runtime Error):
N = int(input())
array = []
for i in range(1,N+1):
    if N // i == 0 and i <= (N // i):
        num = N // i
        array.append(num)
l = len(array)
print(int(array[l]) + (N / int(array[l])))
Problem p02987 (python)

Fixed submission:
S = sorted(list(input()))

if S[0]==S[1] and S[2]==S[3] and S[0]!=S[2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = sort(list(input()))

if S[0]==S[1] and S[2]==S[3]:
  print('Yes')
else:
  print('No')
Problem p03041 (python)

Fixed submission:
n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
st = "".join(s)
print(st)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
st = "".join(s)
print(st)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
#st = "".join(s)
#print(st)
print(s)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
st = "".join(s)
print(st)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
str = "".join(s)
print(str)
Problem p03075 (python)

Fixed submission:
import itertools

lst = [None]*5
for i in range(5):
    s=input()
    lst[i]=s
k = int(input())

lst_sub=[]
lst_C = list(itertools.combinations(lst,2))
for j in range(len(lst_C)):
    sub = abs(int(lst_C[j][0])-int(lst_C[j][1]))
    lst_sub.append(sub)

if max(lst_sub)>k:
    print(":(")
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
lst = [None]*5
for i in range(5):
    s=input()
    lst[i]=s
k = int(input())

c=0
for j in range(4):
    lgth=abs(lst[j]-lst[j+1])
    if lgth>k:
        print(':(')
    elif k==3 and lgth<=k:
        print('Yay!')

Buggy submission (verdict: Runtime Error):
lst = []
for i in range(5):
    s=input()
    lst[i]=s
k = int(input())

c=0
for j in range(4):
    lgth=abs(lst[j]-lst[j+1])
    if lgth>k:
        print(':(')
    elif k==3 and lgth<=k:
        print('Yay!')

Buggy submission (verdict: Runtime Error):
lst = []
for i in range(5):
    s=input()
    lst[i]=s
k = int(input())

c=0
for j in range(4):
    lgth=abs(lst[j]-lst[j+1])
    if lgth>k:
        print(':(')
    elif k=3 and lgth<=k:
        print('Yay!')
Problem p03242 (python)

Fixed submission:
n = list(input())
for i in range(len(n)):
    if n[i]=="1":
        n[i]="9"
    elif n[i]=="9":
        n[i]="1"
print("".join(n))

Buggy submission (verdict: Runtime Error):
n = list(int(input()))
for i in range(len(n)):
    if n[i]==1:
        n[i]=9
    elif n[i]==9:
        n[i]=1
print("".join(n))

Buggy submission (verdict: Runtime Error):
n = list(int(input()))
for i in range(n):
    if n[i]==1:
        n[i]=9
    elif n[i]==9:
        n[i]=1
print("".join(n))
Problem p03250 (python)

Fixed submission:
import itertools
lst = list(map(str,input().split()))
lst1 = list(itertools.permutations(lst))

ans_array = []
for i in range(len(lst1)):
    num1 = int(lst1[i][0]+lst1[i][1]) + int(lst1[i][2])
    num2 = int(lst1[i][0]) + int(lst1[i][1]+lst1[i][2])
    ans_array.append(num1)
    ans_array.append(num2)
print(max(ans_array))

Buggy submission (verdict: Runtime Error):
lst = list(map(int,input().split()))
lst_2 = []
for i in range(len(lst)):
    lstt = lst
    x = lstt[i]
    del lstt[i]
    num = int(x) + int("".join(lstt))
    lst_2.append(num)
print(int(max(lst_2)))

Buggy submission (verdict: Runtime Error):
lst = list(map(int,input().split()))
lst_2 = []
for i in range(len(lst)):
    lstt = lst
    x = lstt[i]
    del lstt[i]
    num = x + int("".join(lstt))
    lst_2.append(num)
print(max(lst_2))
Problem p02695 (python)

Fixed submission:
import math
import itertools

n, m, q = map(int, input().split(" "))
aL = []
_max = 0

for i in range(q):
    aL.append(list(map(int, input().split(" "))))

zLi = itertools.combinations_with_replacement(list(range(m + 1)), n)
for t in zLi:
    if t[0] == 0:
        continue
    _sum = 0
    for a in aL:
        if t[a[1] - 1] - t[a[0] - 1] == a[2]:
            _sum += a[3]
    _max = max(_max, _sum)

print(_max)

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

n, m, q = map(int, input().split(" "))
aL = []
_max = 0

for i in range(q):
    aL.append(list(map(int, input().split(" "))))

li = []


def dfs(i, _n, p):
    if i == n:
        li.append(list(map(int, list(str(_n)))))
        return
    for j in range(p, m + 1):
        dfs(i + 1, _n * 10 + j, j)


if m != 1:
    for i in range(1, m + 1):
        dfs(1, i, i)
else:
    li = [[i] for i in range(1, n + 1)]

for t in li:
    if t[0] == 0:
        continue
    _sum = 0
    for a in aL:
        if t[a[1] - 1] - t[a[0] - 1] == a[2]:
            _sum += a[3]
    _max = max(_max, _sum)

print(_max)

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

n, m, q = map(int, input().split(" "))
aL = []
_max = 0

for i in range(q):
    aL.append(list(map(int, input().split(" "))))

li = []


def dfs(i, _n, p):
    if i == n:
        li.append(list(map(int, list(str(_n)))))
        return
    for j in range(p, m + 1):
        dfs(i + 1, _n * 10 + j, j)


if m != 1:
    for i in range(1, m + 1):
        dfs(1, i, i)
else:
    li = [[i] * m for i in range(1, n + 1)]

for t in li:
    if t[0] == 0:
        continue
    _sum = 0
    for a in aL:
        if t[a[1] - 1] - t[a[0] - 1] == a[2]:
            _sum += a[3]
    _max = max(_max, _sum)

print(_max)
Problem p03038 (python)

Fixed submission:
import math

n, m = map(int, input().split(" "))
aL = sorted(list(map(int, input().split(" "))))
bcL = sorted([list(map(int,
                       input().split(" "))) for _ in range(m)],
             key=lambda x: x[1],
             reverse=True)

csl = 0
for cnt, point in bcL:
    for i in range(cnt):
        if csl == n or aL[csl] >= point:
            print(sum(aL))
            exit()
        aL[csl] = point
        csl += 1

print(sum(aL))
exit()

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split(" "))
aL = sorted(list(map(int, input().split(" "))))
bcL = sorted([list(map(int,
                       input().split(" "))) for _ in range(m)],
             key=lambda x: x[1],
             reverse=True)

csl = 0
for cnt, point in bcL:
    for i in range(cnt):
        if aL[csl] >= point:
            print(sum(aL))
            exit()
        aL[csl] = point
        csl += 1

print(sum(aL))
exit()
Problem p02990 (python)

Fixed submission:
from math import factorial

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

memo = dict()
ans = []
d = 0
for i in range(1, k+1):
    nn = n - k + 1
    if i > nn:
        ans.append("0")
        continue
    k1 = i
    k2 = nn - k1
    nn2 = k - 1
    k3 = i - 1
    k4 = nn2 - k3
    if nn not in memo:
        memo[nn] = factorial(nn)
    if k1 not in memo:
        memo[k1] = factorial(k1)
    if k2 not in memo:
        memo[k2] = factorial(k2)
    if nn2 not in memo:
        memo[nn2] = factorial(nn2)
    if k3 not in memo:
        memo[k3] = factorial(k3)
    if k4 not in memo:
        memo[k4] = factorial(k4)
    c = ((memo[nn] // memo[k2] // memo[k1]) * (memo[nn2] // memo[k4] // memo[k3])) % 1000000007
    ans.append(str(c))
print("\n".join(ans))

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

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

memo = dict()
ans = []
d = 0
for i in range(1, k+1):
    nn = n - k + 1
    k1 = nn - i
    k2 = i
    nn2 = k - 1
    k3 = nn2 - (i - 1)
    k4 = i - 1
    if nn not in memo:
        memo[nn] = factorial(nn)
    if k1 not in memo:
        memo[k1] = factorial(k1)
    if k2 not in memo:
        memo[k2] = factorial(k2)
    if nn2 not in memo:
        memo[nn2] = factorial(nn2)
    if k3 not in memo:
        memo[k3] = factorial(k3)
    if k4 not in memo:
        memo[k4] = factorial(k4)
    c = ((memo[nn] // memo[k1] // memo[k2]) * (memo[nn2] // memo[k3] // memo[k4])) % 1000000007
    ans.append(str(c))
print("\n".join(ans))
Problem p03038 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
hand = []
for _ in range(m):
    b, c = map(int, input().split())
    hand.append((b, c))
hand.sort(key=lambda x: x[1], reverse=True)

i = 0
lena = len(a)
flag = False
for h in hand:
    for j in range(h[0]):
        if i >= lena:
            flag = True
            break
        if a[i] >= h[1]:
            flag = True
            break
        else:
            a[i] = h[1]
            i += 1
    if flag:
        break

print(sum(a))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
hand = []
for _ in range(m):
    b, c = map(int, input().split())
    hand.append((b, c))
hand.sort(key=lambda x: x[1], reverse=True)

i = 0
lena = len(a)
flag = False
for h in hand:
    for j in range(h[0]):
        if i < lena and a[i] >= h[1]:
            flag = True
            break
        else:
            a[i] = h[1]
            i += 1
    if flag:
        break

print(sum(a))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
hand = []
for _ in range(m):
    b, c = map(int, input().split())
    hand.append((b, c))
hand.sort(key=lambda x: x[1], reverse=True)

i = 0
flag = False
for h in hand:
    for j in range(h[0]):
        if a[i] >= h[1]:
            flag = True
            break
        else:
            a[i] = h[1]
            i += 1
    if flag:
        break

print(sum(a))
Problem p02552 (python)

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

Buggy submission (verdict: Runtime Error):
X = int(input())
if X == 1:
    print(0)
else:1
    print(1)
Problem p03038 (python)

Fixed submission:
from heapq import heappush,heappop,heapify

N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
change = [list(map(int,input().split())) for _ in range(M)]

def tempchange(l,change):
  heapify(l)  
  for B,C in change:
    for j in range(B):
      a = heappop(l)
      if C - a > 0:
        heappush(l,C)
      else:
        heappush(l,a)
        break
  return sum(l)

#A.sort(reverse = True)
change.sort(key = lambda x:x[1],reverse =True)
print(tempchange(A,change))

Buggy submission (verdict: Runtime Error):
from heapq import heappush,heappop,heapify

N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
change = [list(map(int,input().split())) for _ in range(M)]

def tempchange(l,change):
  heapify(l)  
  for B,C in change:
    for j in range(B):
      print(l)
      a = heappop(l)
      print(l,a)
      if C - a > 0:
        heappush(l,C)
      else:
        heappush(l,a)
        break
  return sum(l)

#A.sort(reverse = True)
change.sort(key = lambda x:x[1],reverse =True)
print(tempchange(A,change))

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
change = [list(map(int,input().split())) for _ in range(M)]

def tempchange(l,change):
  cnt = []
  total = sum(l)
  for i in range(M):
    B,C = change[i][0],change[i][1]
    for j in range(B):
      dif = C - l[-1]
      if dif > 0:
        l.pop()
        cnt.append(dif)
  return total + sum(cnt)

A.sort(reverse = True)
change.sort(key = lambda x:x[1],reverse =True)
print(tempchange(A,change))

Buggy submission (verdict: Runtime Error):
N,M = list(map(int,input().split()))
A = list(map(int,input().split()))
change = [list(map(int,input().split())) for _ in range(M)]

def tempchange(l,change):
  cnt = []
  total = sum(l)
  for i in range(M):
    B,C = change[i][0],change[i][1]
    for j in range(B):
      dif = C - l[-1]
      if dif > 0:
        l.pop()
        cnt.append(dif)
  return total + sum(cnt)

A.sort(reverse = True)
change.sort(key = lambda x:x[1],reverse =True)
print(tempchange(A,change))
Problem p02659 (python)

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

a = int(a)
b = int(b.replace('.', ''))

print((a * b) // 100)

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

a = int(a)
b = int(b.replcae('.', ''))

print((a * b) // 100)
Problem p02571 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#つまりlist[i] < x となる i の個数
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#つまりlist[i] <= x となる i の個数
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！
s= input()
t = input()
ans = []
for j in range(len(s)-len(t)+1):
    cnt = 0
    moji = s[j:j+len(t)]
    for k in range(len(t)):
        if moji[k] != t[k]:
            cnt += 1
    ans.append(cnt)
print(min(ans))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#つまりlist[i] < x となる i の個数
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#つまりlist[i] <= x となる i の個数
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！
s= input()
t = input()
ans = []

for j in range(len(s)-len(t)):
    cnt = 0
    moji = s[j:j+len(t)]
    for k in range(len(t)):
        if moji[k] != t[k]:
            cnt += 1
    ans.append(cnt)
print(min(ans))
Problem p02597 (python)

Fixed submission:
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

n = I()
c = list(input())
r = c.count('R')
print(c[:r].count("W"))

Buggy submission (verdict: Runtime Error):

import math

def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！

n,k = MI()
a = LI()

def cutting_isOK(x,li,k):
    ans = 0
    for i in range(n):
        ans += math.ceil(li[i]/x) - 1
    if ans <= k:
        return True
    else:
        return False
left = -1
right = 10**9+1
while right != left + 1:
    mid = (left+right)//2
    if cutting_isOK(mid,a,k):
        right = mid
    else:
        left = mid
print(right)
Problem p02623 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！
n,m,k = MI()
a = LI()
b = LI()
a_cum = [0]
b_cum = [0]
ans = 0
for i in range(1,n+1):
    a_cum.append(a[i-1]+a_cum[i-1])
for i in range(1,m+1):
    b_cum.append(b[i-1]+b_cum[i-1])
for i in range(m+1):
    K = k-b_cum[i]
    if K >= 0:
    #K以下で最大のa_cum[j]を求め出力するのはi+j
      j = bisect.bisect_right(a_cum, K) - 1
      ans = max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
  bunshi=1
  bunbo=1
  for i in range(r):
    bunbo = bunbo*(i+1)%mod
    bunshi = bunshi*(n-i)%mod
  return (bunshi*pow(bunbo,mod-2,mod))%mod
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

#bisect.bisect_left(list,key)はlistのなかでkey未満の数字がいくつあるかを返す
#bisect.bisect_right(list, key)はlistのなかでkey以下の数字がいくつあるかを返す
#これを応用することで
#len(list) - bisect.bisect_left(list,key)はlistのなかでkey以上の数字がいくつあるかを返す
#len(list) - bisect.bisect_right(list,key)はlistのなかでkeyより大きい数字がいくつあるかを返す
#これらを使うときはあらかじめlistをソートしておくこと！
n,m,k = MI()
a = deque(LI())
b = deque(LI())
ans = 0
while k > 0 and len(a) + len(b) > 0:
    if len(a) > 0:
        book = a.popleft()
    if len(a) == 0:
        book = 10**10
    if len(b) > 0:
        book2 = b.popleft()
    if len(b) == 0:
        book2 = 10**10
    if book < book2:
        k -= book
        if k > 0:
            ans += 1
    if book > book2
        k -= book2
        if k > 0:
            ans += 1
print(ans)
Problem p02771 (python)

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

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

Fixed submission:
n = int(input())
if n%2 == 0:
  n = n//2
  ans = 0
  k=5
  while k<= n:
    ans += n // k
    k *= 5
  print(ans)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import math
  
n=int(input())
if n%2 == 0:
  k = n%10
  t = n-k
  ans = 0
while t%5 == 0:
  s = t//5
  ans += s
  t = s
print(ans//2)
if n%2 == 1:
  print(0)
Problem p02891 (python)

Fixed submission:
import math

s = list(input())
k =int(input())
cnt1 = 0
cnt2 = 0
ans = 0
i = 0
j = len(s)-1
p = False
n = 0
if len(s) == 1:
  answer = math.floor(k/2)
else:
  while s[0] == s[n]:
    n += 1
    if n == len(s)-1:
      p = True
      break
  if p == True:
    answer = math.floor(len(s)*k/2)
  if p == False:
    t = False
    while s[0] == s[i]:
      i+= 1
    cnt1 = i 
    while s[-1] == s[j]:
      j = j-1
    cnt2 = len(s)-j-1
    if s[0] == s[-1]:
      t = True
    new_s = s[cnt1:len(s)-cnt2]
    for i in range(len(new_s)-1):
        if new_s[i] == new_s[i+1]:
          new_s[i+1] = "0"
          ans += 1
    if t == True:
      ans_2 = math.floor((cnt1+cnt2)/2)
      answer = ans*k + ans_2*(k-1) + math.floor(cnt1/2) + math.floor(cnt2/2)
    if t == False:
      answer = ans*k + math.floor(cnt1/2)*k + math.floor(cnt2/2)*k
print(answer)

Buggy submission (verdict: Runtime Error):
import math

s = list(input())
k =int(input())
cnt1 = 0
cnt2 = 0
ans = 0
i = 0
j = len(s)-1
p = False
n = 0
while s[0] == s[n]:
  n += 1
  if n == len(s)-1:
    p = True
    break
if p == True:
  answer = math.floor(len(s)*k/2)
if p == False:
  t = False
  while s[0] == s[i]:
    i+= 1
  cnt1 = i 
  while s[-1] == s[j]:
    j = j-1
  cnt2 = len(s)-j-1
  if s[0] == s[-1]:
    t = True
  new_s = s[cnt1:len(s)-cnt2]
  for i in range(len(new_s)-1):
      if new_s[i] == new_s[i+1]:
        new_s[i+1] = "0"
        ans += 1
  if t == True:
    ans_2 = math.floor((cnt1+cnt2)/2)
    answer = ans*k + ans_2*(k-1) + math.floor(cnt1/2) + math.floor(cnt2/2)
  if t == False:
    answer = ans*k + math.floor(cnt1/2)*k + math.floor(cnt2/2)*k
print(answer)
Problem p03075 (python)

Fixed submission:
li = []
for i in range(6):
  li.append(int(input()))
if li[4] - li[0] <= li[5]:
  print("Yay!")
else:
  print(":(")

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
li=[int(input()) for i in range(n)]
print(math.ceil(n/min(li))+4)