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

Fixed submission:
s=input()
t=input()

t_l = len(t)
diff_min = 999999999

def diff_str(s1, s2):
    diff_c = 0
    for j in range(len(s1)):
        if s1[j] != s2[j]:
            diff_c += 1
    return diff_c

if len(s) == len(t):
    diff_min = diff_str(s, t)

for i in range(len(s)-t_l):
    seq=s[i:i+t_l]
    diff_c = diff_str(seq, t)
    if diff_c < diff_min:
        diff_min = diff_c


print(diff_min)

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

t_l = len(t)
diff_min = 999999999

def diff_str(s1, s2):
    diff_c = 0
    for j in range(len(seq)):
        if s1[j] != s2[j]:
            diff_c += 1
    return diff_c

if len(s) == len(t):
    diff_min = diff_str(s, t)

for i in range(len(s)-t_l):
    seq=s[i:i+t_l]
    diff_c = diff_str(seq, t)
    if diff_c < diff_min:
        diff_min = diff_c


print(diff_min)
Problem p02688 (python)

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

lst = [0] * N

for i in range(K):
	d = input()
	A = list(map(int, input().split()))
	for a in A:
		lst[a-1] += 1

print(lst.count(0))

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

lst = [0] * N

for i in range(K):
	d = input()
    A = list(map(int, input().split()))
    for a in A:
    	lst[a-1] += 1

print(lst.count(0))
Problem p02693 (python)

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

for cnt in range(a, b + 1):
  if cnt % k == 0:
    print('OK')
    break
  elif cnt + 1 == b + 1:
    print('NG')

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

if b -a >= k and k < a
  print('OK')
else:
  print('NG')
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')

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

if s < w
    out = 'unsafe'
else:
    out = 'safe'

print(out)

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

if s < w
    out = 'unsafe'
else
    out = 'safe'

print(out)
Problem p02701 (python)

Fixed submission:
n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)

Buggy submission (verdict: Runtime Error):
n = int(input())
counter = 0
s = "TEMP"
list = []

while n > 0:
  s = input()
  list.append(s)
  counter = 0
  for item in list:
    if item == s
      counter = counter - 1
    counter = counter + 1
  n = n - 1

print(counter)

Buggy submission (verdict: Runtime Error):
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

Buggy submission (verdict: Runtime Error):
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

Buggy submission (verdict: Runtime Error):
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

Buggy submission (verdict: Runtime Error):
n = input()
counter = 0
s = ""
temp = ""

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1
Problem p02729 (python)

Fixed submission:
import math

n, m = map(int, input().split())


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


if m >= 2:
    odd = combinations_count(m, 2)
elif m == 0 or m == 1:
    odd = 0

if n >= 2:
    even = combinations_count(n, 2)
elif n == 1:
    even = 1
elif n == 0:
    even = 0

answer = odd + even
if m == 1 and n == 1:
    answer = 0

print(answer)

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())

ans = n*(n-1)//2 + m(m-1)//2
print(ans)
Problem p02912 (python)

Fixed submission:
import heapq
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
A = map(int, input().split())
A = list(map(lambda x: x*(-1), A))
heapq.heapify(A)

for _ in range(m):
    max_price = -heapq.heappop(A) // 2
    heapq.heappush(A, -max_price)

total = -sum(A)
print(total)

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

input = sys.stdin.readline

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

BC = [tuple(map(int, input().split())) for _ in range(m)]

for b, c in BC:
    for _ in range(b):
        A.append(c)

A = list(map(lambda x: -x, A))
heapify(A)

answer = 0
for _ in range(n):
    answer += heappop(A)

print(-answer)
Problem p02933 (python)

Fixed submission:
print('red' if int(input()) < 3200 else input())

Buggy submission (verdict: Runtime Error):
print('red' if int(input() < 3200 else input())
Problem p03250 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(10*a+b+c if 10*a+b+c a+10*b+c else a+10*b+c)

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(10a+b if 10a+b>=10b+c else 10b+c)
Problem p03265 (python)

Fixed submission:
x1, y1, x2, y2 = map(int, input().split())

# 回転行列が王道らしい
x3 = x2-(y2-y1)
y3 = y2+(x2-x1)
x4 = x1-(y2-y1)
y4 = y1+(x2-x1)

print(x3, y3, x4, y4)

Buggy submission (verdict: Runtime Error):
k = int(input())
print((k//2)*((k+1)//2)
Problem p03631 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
print("Yes" if n[0]== n[2] else 'No' )

Buggy submission (verdict: Runtime Error):
n = int(input())
print('Yes' if n[0] == n[2] else 'No')
Problem p03013 (python)

Fixed submission:
patterns_dictionary = {}
patterns_dictionary[1] = 1
patterns_dictionary[2] = 1


def patterns(start_n, broken_n):
    # start;自分がいる場所，こわれていない．一つ前はこわれている
    diff = broken_n - start_n
    if diff in patterns_dictionary:
        return patterns_dictionary[diff]
    for ii in range(len(patterns_dictionary)+1, diff+1):
        patterns_dictionary[ii] = patterns_dictionary[ii-1] + patterns_dictionary[ii-2]
    ans = patterns(start_n, broken_n - 1) + patterns(start_n, broken_n - 2)
    patterns_dictionary[diff] = ans
    return ans


inp = input()
split_input = inp.split()
n = int(split_input[0])
m = int(split_input[1])
start = 0
patterns_count = 1
# broken_number = -1
for i in range(m+1):
    if i == m:
        broken = n + 1
    else:
        inp = input()
        broken = int(inp)
    if broken == start:
        # 二つ連続で通れない
        print(0)
        exit()
    # print(start, broken)
    p = patterns(start, broken)
    patterns_count = (patterns_count * p) % 1000000007
    start = broken + 1

print(patterns_count)

Buggy submission (verdict: Runtime Error):
def patterns(start_n, broken_n):
    # start;自分がいる場所，こわれていない．一つ前はこわれている
    diff = broken_n - start_n
    if diff == 1 or diff == 2:
        return 1
    return patterns(start_n, broken_n - 1) + patterns(start_n, broken_n - 2)


inp = input()
split_input = inp.split()
n = int(split_input[0])
m = int(split_input[1])
start = 0
patterns_count = 1
# broken_number = -1
for i in range(m+1):
    if i == m:
        broken = n + 1
    else:
        inp = input()
        broken = int(inp)
    if broken == start:
        # 二つ連続でと通れない
        print(0)
        exit()
    # print(start, broken)
    p = patterns(start, broken)
    patterns_count = patterns_count * p % 1000000007
    start = broken + 1

print(patterns_count)
Problem p02629 (python)

Fixed submission:
alphabets = "abcdefghijklmnopqrstuvwxyz"


n = int(input())

A = []
while True:
    A.append(n % 26)
    n //= 26
    if n == 0:
        break

for i in range(len(A) - 1):
    if A[i] <= 0:
        A[i] += 26; A[i + 1] -= 1

ANS = []
for a in A[::-1]:
    if a == 0:
        continue
    ANS.append(alphabets[a - 1])

print("".join(ANS))

Buggy submission (verdict: Runtime Error):
alphabet = "abcdefghijklmnopqrstrvwxyz"


n = int(input()) - 1

A = []
while n > 0:
    A.append(n % 26)
    n //= 26

m = len(A)

if m == 1:
    print(alphabet[A[0]])
    exit()

ANS = []
ANS.append(alphabet[A[0]])
for i in range(1, m - 1):
    if A[i] == 0:
        ANS.append("z")
        A[i + 1] -= 1
    else:
        ANS.append(alphabet[A[i] - 1])
if A[-1]:
    ANS.append(alphabet[A[-1] - 1])

print("".join(ANS[::-1]))
Problem p02990 (python)

Fixed submission:
import math
N,K = (int(x) for x in input().split())
R = N - K
mod = 10**9 + 7
def fact(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(1,K+1):
    ans = 0 if N - K + 1 < i else fact(R+1, i)*fact(K-1,i-1)
    print(int(ans)%mod)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
from math import factorial
import numpy as np
for i in range(1,k+1):
    perm = factorial(n-k+1)/factorial((n-k+1)-i)
    tmp = np.ceil(k/i)
    a, b = int(k//tmp), int(k%tmp)
    perm /= (factorial(a)*factorial(b))
    print(int(perm)%(10**9+7))
Problem p03104 (python)

Fixed submission:
# A, B = map(int, input().split())
# l = list(range(A,B))
# l += [B]
# l = [list("{:0>42}".format(format(i, 'b'))) for i in l]

# import numpy as np
# l = np.array(l)

# ans = ''
# for i in range(42):
#     if np.sum(l[:, i] == '1') % 2 == 1:
#         ans += '1'
#     else:
#         ans += '0'
# print(int(str(ans), 2))

A, B = map(int, input().split())
def xor(x):
    mod = x % 4
    if mod == 0:
        return x
    elif mod == 1:
        return 1
    elif mod == 2:
        return x ^ 1
    elif mod == 3:
        return 0
print(xor(A-1) ^ xor(B))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
l = list(range(A,B))
l += [B]
l = [list("{:0>40}".format(format(i, 'b'))) for i in l]

import numpy as np
l = np.array(l)

ans = ''
for i in range(40):
    if np.sum(l[:, i] == '1') % 2 == 1:
        ans += '1'
    else:
        ans += '0'
print(int(ans, 2))
Problem p03107 (python)

Fixed submission:
S = list(input())
print(min(S.count('0'), S.count('1')) * 2)

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

def f(S):
    new_array = []
    mark = False
    if len(S) == 2:
        if S[0] != S[1]:
            return []
        else:
            return S

    for i in range(0, len(S) - 2):
        if i % 3 == 0:
            if S[i] == S[i + 1] and S[i + 1] == S[i + 2]:
                new_array += [S[i], S[i+1], S[i+2]]
            elif S[i] != S[i + 1]:
                new_array += [S[i+2]]
                if mark == False:
                    mark = True
            elif S[i + 1] != S[i + 2]:
                new_array += [S[i]]
                if mark == False:
                    mark = True
    
    if len(S) % 3 == 1:
        if S[-2] != S[-1]:
            new_array.pop(-1)
        else:
            new_array += [S[-1]]
    elif len(S) % 3 == 2:
        if S[-2] == S[-1]:
            new_array += [S[-2], S[-1]]

    if mark == True:
        return f(new_array)
    else:
        return new_array


print(len(S) - len(f(S)))
Problem p03108 (python)

Fixed submission:
class UnionFind:
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]

    def root(self, x):
        """要素xの根の番号を返す"""
        if self.parent[x] < 0:
            return x
        self.parent[x] = self.root(self.parent[x])
        return self.parent[x]

    def size(self, x):
        """所属するグループの頂点数を調べる"""
        return -self.parent[self.root(x)]

    def marge(self, x, y):
        """xとyを結合する"""
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.size(x) < self.size(y):
            x, y = y, x
        self.parent[x] += self.parent[y]
        self.parent[y] = x  # 親を更新
        return True

n, m = map(int, input().split())
bridges = []
for i in range(m):
    bridges.append([int(s) - 1 for s in input().split()])

ans = [n * (n-1) // 2]
uf = UnionFind(n)
for i in range(m-1, 0, -1):
    a, b = bridges[i]
    if uf.root(a) == uf.root(b):
        ans.append(ans[-1])
    else:
        size_a = uf.size(a)
        size_b = uf.size(b)
        ans.append(ans[-1] - size_a * size_b)
        uf.marge(a, b)
ans.reverse()
print('\n'.join(map(str, ans)))

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

def find_root(components, n):
    print(components, n)
    if components[n] == n:
        return n
    else:
        components[n] = find_root(components, components[n])
        return components[n]

bridges = []
for i in range(M):
    bridges.append([int(s) - 1 for s in input().split()])

components = [i for i in range(N)]
components_len = [1] * N
inconv = [int(N * (N-1) / 2)]

print(bridges)
for i in range(M-1, -1, -1):
    a, b = bridges[i]
    a_root, b_root = find_root(components, a), find_root(components, b)
    print(a_root, b_root)
    if a_root != b_root:
        inconv.append(inconv[-1] - components_len[a_root] * components_len[b_root])
        if components_len[a_root] < components_len[b_root]:
            a_root, b_root = b_root, a_root
        components_len[a_root] += components_len[b_root]
        components_len[b_root] = a_root
    else:
        inconv.append(inconv[-1])
Problem p03127 (python)

Fixed submission:
# import math
from functools import reduce
input()
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

def gcds(*numbers):
    return reduce(gcd, numbers)
print(gcds(*[int(i) for i in input().split()]))

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
input()
def gcd(*numbers):
    return reduce(math.gcd, numbers)
print(gcd(*[int(i) for i in input().split()]))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
input()
def gcd(*numbers):
    return reduce(math.gcd, numbers)
print(gcd(*[int(i) for i in input().split()]))

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [int(i) for i in input().split()]

l = sorted(l)

sema = True
for i in range(len(l)):
    for j in range(i + 1,len(l)):
        if not l[j] % l[i] == 0:
            sema = False
            break
pre = min(l)
if sema == True:
    print(pre)
else:
    m = l[1] % l[0]
    for i in range(2, len(l)):
        a = l[i] % m
        if a < m and a >= 1:
            m = a
        else:
            print(m)

Buggy submission (verdict: Runtime Error):
N = int(input())
l = [int(i) for i in input().split()]

l = sorted(l)


sema = True
mod_list = []
for i in range(len(l)):
    for j in range(i + 1,len(l)):
        if not l[j] % l[i] == 0:
            sema = False
            mod_list.append(l[j] % l[i])
mod_list = set(mod_list)
if sema == True:
    print(min(l))
else:
    ans = min(l)
    print(min([i % m for i in l for m in mod_list if i % m != 0]))
Problem p03207 (python)

Fixed submission:
n = int(input()); l=sorted([int(input()) for _ in range(n)])
print(int(sum(l)-l[-1]/2))

Buggy submission (verdict: Runtime Error):
n = input(); l=sorted([int(input()) for _ in range(n)])
print(int(sum(l)-l[-1]/2))
Problem p03327 (python)

Fixed submission:
a = input()
a = int(a)

if a > 999:
    print("ABD")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
import numpy as np
a, b = input().split(" ")
a = int(a)
b = int(b)

c = b - a
s = sum(list(np.arange(c)))
print(s - a)
Problem p03041 (python)

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

mojiretu_list = [0 for _ in range(N)]
for i in range(N):
    mojiretu_list[i] = string[i]

if mojiretu_list[k-1] == 'A':
    mojiretu_list[k-1] = 'a'

if mojiretu_list[k-1] == 'B':
    mojiretu_list[k-1] = 'b'

if mojiretu_list[k-1] == 'C':
    mojiretu_list[k-1] = 'c'

ans = ''
for i in range(N):
    ans += mojiretu_list[i]

print(ans)

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

mojiretu_list = [0 for _ in range(N)]
for i in range(N):
    mojiretu_list[i] = string[i]

if mojiretu_list[k] == 'A':
    mojiretu_list[k] = 'a'

if mojiretu_list[k] == 'B':
    mojiretu_list[k] = 'b'

if mojiretu_list[k] == 'C':
    mojiretu_list[k] = 'c'

ans = ''
for i in range(N):
    ans += mojiretu_list[i]

print(ans)
Problem p03042 (python)

Fixed submission:
string = input()

moji_list = [0 for _ in range(4)]
for i in range(4):
    moji_list[i] = string[i]

ue = ''
sita = ''
for j in range(2):
    ue += moji_list[j]
    sita += moji_list[j+2]

int_ue = int(ue)
int_sita = int(sita)

sw_ue = 0
sw_sita = 0
if 1<=int_ue and int_ue<=12:
    sw_ue += 1

if 1<=int_sita and int_sita<=12:
    sw_sita += 1

if sw_ue == 1 and sw_sita == 1:
    print('AMBIGUOUS')
elif sw_ue == 1 and sw_sita == 0:
    print('MMYY')
elif sw_ue == 0 and sw_sita == 1:
    print('YYMM')
elif sw_ue == 0 and sw_sita == 0:
    print('NA')

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

moji_list = []
for i in range(4):
    moji_list[i] = string[i]

ue = ''
sita = ''
for j in range(2):
    ue += moji_list[i]
    sita += moji_list[i+2]

int_ue = int(ue)
int_sita = int(sita)

sw_ue = 0
sw_sita = 0
if 1<=int_ue and int_ue<=12:
    sw_ue += 1

if 1<=int_sita and int_sita<=12:
    sw_sita += 1

if sw_ue == 1 and sw_sita == 1:
    print('AMBIGUOUS')
elif sw_ue == 1 and sw_sita == 0:
    print('MMYY')
elif sw_ue == 0 and sw_sita == 1:
    print('YYMM')
elif sw_ue == 0 and sw_sita == 0:
    print('NA')
Problem p02598 (python)

Fixed submission:
n,k =  map(int,input().split())
A = list(map(int,input().split()))

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    if m==0:
        m=1
        break

    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)

Buggy submission (verdict: Runtime Error):

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [  int((A[i]-0.1)//(m)) for i in range(len(A)) ] )
    
    print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m+=1
            break
        l=m+1
        

        
print(m)

Buggy submission (verdict: Runtime Error):

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [A[i]+0.1//m for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m=m+1
            break
        l=m+1
        

        
print(m)

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while 1:
    
    m = (l+r)//2
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum( [A[i]//m - A[i]%m==0 for i in range(len(A)) ] )
    
    # print(l,m,r,n)
    
    if n<=k:
        if r==m:
            break
        r=m-1
    else:
        if l==m:
            m=m+1
            break
        l=m+1
        

        
print(m)

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

l = min(A)//(k+1) 
r = max(A)
m = (l+r)//2+1

while l<=r:
    
    m = (l+r)//2+1
    
    #m以下の長さにできるか判定
    
    # A_long = A[A>m]
    n= sum([A[i]//m for i in range(len(A)) ] )
    
    print(l,m,r,n)
    
    if n<=k:
        r=m-1
    else:
        l=m+1
        m=m+1

        
print(m)
Problem p02623 (python)

Fixed submission:
n,m,k = map(int,input().split()) 
Al=list(map(int,input().split()) )
Bl=list(map(int,input().split()) )
bmax=0
A=[0]
B=[0]
for i in range(1,n+1):
    A.append(A[i-1]+Al[i-1])  
for i in range(1,m+1):
    B.append(B[i-1]+Bl[i-1])
    if B[i]<=k:
        bmax=i

ans=0
b=bmax
for a in range(len(A)):
    if A[a]>k:
        break
    # ans = max(ans, a+1)
    
    while A[a] + B[b] >k and b>=0:
        b -= 1
        
        
    ans = max(ans, a+b)
        
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,k = map(int,input().split()) 
Al=list(map(int,input().split()) )
Bl=list(map(int,input().split()) )
bmax=0
A=[0]
B=[0]
for i in range(1,n+1):
    A[i] += A[i-1]+Al[i]  
for i in range(1,m+1):
    B[i] += B[i-1]+Bl[i]
    if B[i]<=k:
        bmax=i

ans=0
b=bmax
for a in range(len(A)):
    if A[a]>k:
        break
    # ans = max(ans, a+1)
    
    while A[a] + B[b] >k and b>=0:
        b -= 1
        
        
    ans = max(ans, a+b+2)
        
print(ans)
Problem p02659 (python)

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

n=int(n)
m=float(m)*100+0.5
m=int(m)

ans = int(n*m//100)

print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split()) 
print(n*m)
Problem p03315 (python)

Fixed submission:
s=input()
n=0
for i in range(4):
    if(s[i]=='+'):
        n=n+1
    if(s[i]=='-'):
        n=n-1
print(n)

Buggy submission (verdict: Runtime Error):
N=int(input())
la=[]
buff=0
for i in range(1,10):
    la.append(int(N/10**i))
la.append(N%10)
buff=sum(la)
if(N%buff==0):
    print("Yes")
else:
    print("No")
Problem p03332 (python)

Fixed submission:
li = input().split()
N=int(li[0])
A=int(li[1])
B=int(li[2])
K=int(li[3])
mod = 998244353 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0;
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
count=0
for i in range (N+1):
    if(((A+B)*N-A*i-K)%B==0):
        k=((A+B)*N-A*i-K)//B
        ca=cmb(N,i,mod)
        cb=cmb(N,k,mod)
        count=count+ca*cb
print(count%mod)

Buggy submission (verdict: Runtime Error):
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
N1=10**4+1
for i in range( 2, N1 + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
li = input().split()
N=int(li[0])
A=int(li[1])
B=int(li[2])
K=int(li[3])
count=0
for i in range (N+1):
    for k in range(N+1):
        if((A+B)*N-A*i-B*k==K):
            
            ca=cmb(N, i,mod)
            cb=cmb(N,k,mod)
            count=count+ca*cb
print(count%mod)

Buggy submission (verdict: Runtime Error):
from scipy.special import perm, comb
li = input().split()
N=int(li[0])
A=int(li[1])
B=int(li[2])
K=int(li[3])
count=0
for i in range (N+1):
    for k in range(N+1):
        if((A+B)*N-A*i-B*k==K):
            ca=comb(N, i, exact=True)
            cb=comb(N,k,exact=True)
            count=count+ca*cb
print(count%998244353)
Problem p02570 (python)

Fixed submission:
d,t,s = list( map( int , input().split() ))
if d <= t*s:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
d,t,s = list( map( int , input().split() ))
if d <= t*s:
  return "Yes"
else:
  return "No"