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

Fixed submission:
N = int(input())
P = [int(input()) for _ in range(N)]
P.sort()
print(P[-1]//2 + sum(P[:N-1]))

Buggy submission (verdict: Runtime Error):
n = input()
p = [int(input()) for _ in range(n)]
print(p.pop()//2 + sum(p))
Problem p02595 (python)

Fixed submission:
import math
N,D = map(int,input().split())
 
ans = 0
for i in range(N):
  x,y = map(int,input().split())
  d = math.sqrt(x**2 + y**2)
  if d <= D:
    ans += 1
print(ans)

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

ans = 0
for i in range(N):
  x,y = map(int,input().split())
  d = math.sprt(x**2 + y**2)
  if d <= D:
    ans += 1
print(ans)
Problem p02623 (python)

Fixed submission:
def resolve():
    N,M,K = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    Asum, Bsum = [0], [0]
    for i in range(N):
        Asum.append(A[i] + Asum[i])
    for i in range(M):
        Bsum.append(B[i] + Bsum[i])   

    ans = 0
    j = M
    for i in range(N+1):
        if Asum[i] > K:
            break
        while Bsum[j] > K - Asum[i]:
            j-=1         
        ans = max(ans,i+j)
    print(ans)
resolve()

Buggy submission (verdict: Runtime Error):
import numpy as np
def resolve():
    N,M,K = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    Amax_idx = N
    Asum = np.zeros(N+1, dtype = int)
    for i in range(1,N+1):
        Asum[i] = Asum[i-1] + A[i-1]
        if Asum[i] > K:
            Amax_idx = i - 1
            break

    ans = Amax_idx
    ansmax = ans
    anssum = Asum[Amax_idx]
    Acount = 0
    for i in range(M):
        anssum += B[i]
        while anssum > K:
            anssum -= A[Amax_idx - Acount]
            Acount += 1
            if Acount > Amax_idx:
                print(ansmax)
                return
            ans -= 1
        ans += 1  
        ansmax = max(ansmax,ans)
    print(ansmax)
resolve()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
def resolve():
    N,M,K = map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    Amax_idx = N
    Asum = np.zeros(N+1, dtype = int)
    for i in range(1,N+1):
        Asum[i] = Asum[i-1] + A[i-1]
        if Asum[i] > K:
            Amax_idx = i - 1
            break

    ans = Amax_idx
    ansmax = ans
    anssum = Asum[Amax_idx]
    Acount = 0
    for i in range(M):
        anssum += B[i]
        while anssum > K:
            anssum -= A[Amax_idx - Acount]
            Acount += 1
            if Acount < 0:
                print(ansmax)
                sys.exit()
            ans -= 1
        ans += 1  
        ansmax = max(ansmax,ans)
    print(ansmax)
resolve()
Problem p02578 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = 0
i = 1
while i < N:
    if A[i] - A[i-1] < 0:
        B += A[i-1] - A[i]
        A[i] = A[i-1]
    i += 1
print(B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = 0
i = 1
while i <= N:
    if A[i] > A[i-1]:
        B += A[i] - A[i-1]
        A[i] = A[i-1]
print(B)
Problem p02623 (python)

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

a,b=[0],[0]
for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])

j,ans=m,0
for i in range(n+1):
    if a[i]>k:
        break
    while b[j] > k-a[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
from decimal import *
n,m,k=map(Decimal,input().split())
a=list(map(Decimal,input().split()))
b=list(map(Decimal,input().split()))

a.append(10**9+1)
b.append(10**9+1)
k/=10**9
i,j,ans=0,0,0
while k>=0:
    if a[i]>10**9:
        k-=Decimal(b[j]/(10**9))
        j+=1
    elif b[i]>10**9:
        k-=Decimal(a[i]/(10**9))
        i+=1
    elif a[i]>b[j]:
        k-=Decimal(b[j]/(10**9))
        j+=1
    else:
        k-=Decimal(a[i]/(10**9))
        i+=1
    if k<0:
        break
    ans+=1

print(ans)

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

a.append(10**9+1)
b.append(10**9+1)

i,j,ans=0,0,0
while k>=0:
    if a[i]>10**9:
        k-=b[j]
        j+=1
    elif b[i]>10**9:
        k-=a[i]
        i+=1
    elif a[i]>b[j]:
        k-=b[j]
        j+=1
    else:
        k-=a[i]
        i+=1
    if k<0:
        break
    ans+=1

print(ans)

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

a.append(10**9+1)
b.append(10**9+1)

i,j,ans=0,0,0
while k>=0:
    print(i,j)
    if a[i]>10**9:
        k-=b[j]
        j+=1
    elif b[i]>10**9:
        k-=a[i]
        i+=1
    elif a[i]>b[j]:
        k-=b[j]
        j+=1
    else:
        k-=a[i]
        i+=1
    if k<0:
        break
    ans+=1

print(ans)
Problem p02659 (python)

Fixed submission:
import math
import decimal
a,b=map(str,input().split())
print(math.trunc(decimal.Decimal(a)*decimal.Decimal(b)))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(str,input().split())
print(int(int(a)*b))
Problem p02629 (python)

Fixed submission:
n=int(input())

basis=[26**i for i in range(12)]
l=[]
s=0
for b in basis:
    s+=b
    l.append(s)    

i=0
f=12
while(f-i>1):
#     print(f-i)
    x=(i+f)//2
    if l[x]>n:
        f=x
    else:
        i=x

k=n-l[i]
length=i+1

res=[]
for i in range(length):
    q=k//26
    r=k%26
    k=q
    res.append(r)

ans=list(map(lambda x: chr(ord("a")+x),list(reversed(res))))
print("".join(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())-1
if n!=0:
    res=[]
    for b in reversed(basis):
        res.append(n//b)
        n=n%b

    ans=[]
    flag=False
    for x in res:
        if x!=0:
            flag=True
        if flag:
            ans.append(chr(ord("a")+x))

    print("".join(ans))
else:
    print("a")

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

ans=[]
while(n!=0):
    m=n%p
    n=n//p
    ans.append(m)

res=list(map(lambda x: chr(ord("a")-1+x),ans))

print("".join(res))
Problem p02659 (python)

Fixed submission:
a,b=map(str,input().split())
tempb=int(float(b)*1000)
tempa=int(a)
print(int(tempa*tempb)//1000)

Buggy submission (verdict: Runtime Error):
a,b=map(float,input().split())
b=int(float(b)*100)
a=int(a)
print(int(a*tempb)//100)

Buggy submission (verdict: Runtime Error):
a,b=map(float,input().split())
tempb=int(floor(b)*1000)
print(int(a*tempb)//1000)

Buggy submission (verdict: Runtime Error):
a,b=map(float,input().split())
tempb=int(b*1000)
print(int(tempa*tempb)//1000)
Problem p02836 (python)

Fixed submission:
S=input()
n=len(S)
ans=0
for i in range(n//2):
    if S[i]!=S[n-i-1]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=len(S)
ans=0
for i in range(n//2):
    if S[i]!=S[n-i-1]:
        ans+=1
print(ans)
Problem p02862 (python)

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

mod=10 ** 9 + 7
def binomial(n,k):
    x=1
    y=1
    for i in range(k):
        x=x*(n-i)%mod
        y=y*(i+1)%mod
    return x*pow(y,mod-2,mod)%mod

if (2*X-Y)%3==0 and  (2*Y-X)%3==0:
    a=(2*X-Y)//3
    b=(2*Y-X)//3
    if a<0 or b<0:
        print(0)        
    else:
        print(binomial(a+b,a)%mod)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
X,Y = map(int, input().split())

mod=10 ** 9 + 7
def binomial(n,k):
    x=1
    y=1
    for i in range(k):
        x=x*(n-i)%mod
        y=y*(i+1)%mod
    return x*power(y,mod-2)%mod

a=(2*X-Y)//3
b=(2*Y-X)//3

print(binomial(a+b,a)%mod)

Buggy submission (verdict: Runtime Error):
import math
# from scipy.special import factorial, poch
ppp=10**9+7
x,y =map(int, input().split())
a=[-(x-2*y)//3,-(-2*x+y)//3]
b=[-(x-2*y)%3,-(-2*x+y)%3]
if b[0]==0 and b[1]==0:
    print(math.factorial(a[0]+a[1])//math.factorial(a[0])//math.factorial(a[1])%ppp)
    
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math
from scipy.special import factorial, poch
ppp=10**9+7
x,y =map(int, input().split())
a=[-(x-2*y)//3,-(-2*x+y)//3]
b=[-(x-2*y)%3,-(-2*x+y)%3]
if b[0]==0 and b[1]==0:
    print(math.factorial(a[0]+a[1])//math.factorial(a[0])//math.factorial(a[1])%ppp)
    
else:
    print(0)
Problem p02881 (python)

Fixed submission:
N=int(input())

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

    # divisors.sort()
    return divisors

ans=10**12
for i in make_divisors(N):
    j=N//i
    if ans>i+j:
        ans=i+j

print(ans-2)

Buggy submission (verdict: Runtime Error):
A,B,X=map(int, input().split())
C=2*X/(A*B)
if C<=A:
    math.atan(B/C)*(180)/math.pi
    C=2*X/(A*B)
    print(math.atan(B/C)*(180)/math.pi)
else:
    C=2*Y/(A*A)
    Y=A*A*B-X
    C=2*Y/(A*A)
    print(math.atan(C/A)*(180)/math.pi)
Problem p02912 (python)

Fixed submission:
import heapq

N,M = map(int, input().split())
A = list(-int(i) for i in input().split()) 

heapq.heapify(A)

for i in range(M):
    x=heapq.heappop(A)//(-2)
    heapq.heappush(A, -x)

print(-sum(A))

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.index(max(A))
A.sort()
B=[A.pop()//2]
M-=1

while(M):
    if A[-1]>B[-1]:
        B.insert(0,A.pop()//2)
    else:
        b=B.pop()//2
        B.insert(0,b)
    M-=1
    
print(sum(A)+sum(B))

Buggy submission (verdict: Runtime Error):
N,M=map(int, input().split())
A=list(map(int, input().split()))
A.index(max(A))
A.sort()
a=A.pop()
b=A.pop()
for i in range(M):
    if a>=b:
        a=a//2
    else:
        A.append(a)
        A.append(b//2)
        A.sort()
        a=A.pop()
        b=A.pop()
        
print(sum(A)+a+b)
Problem p02571 (python)

Fixed submission:
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0
count=0
for i in range(s-t+1):
  for j in range(t):
    if T[j]==S[i+j]:
      count += 1
  max_count=max(max_count,count)
  count=0  
print(t-max_count)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0
count=0
for i in range(s-t+1):
  for j in range(t):
    if T[i]==S[j+i]:
      count += 1
  max_count=max(max_count,count)
  count=0  
print(t-max_count)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
s=len(S)
t=len(T)
max_count=0

for i in range(s-t+1):
  count=0
  for j in range(t):
    if T[i]==S[j+i]:
      count += 1
  max_count=max(max_count,count)
    
print(t-max_count)
Problem p02595 (python)

Fixed submission:
n, d = map(int, input().split())
count = 0

for i in range(n):
    x, y = map(int, input().split())
    if d * d >= x * x + y * y:
        count = count + 1

print(count)

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

for i in range(n):
    x, y = map(int, input(), split())
    if d^2 >= x^2 + y^2:
        count += 1

print(count)
Problem p02689 (python)

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

ans = [0] * n

for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] < h[b - 1]:
        ans[a - 1] += 1
    elif h[a - 1] > h[b -1]:
        ans[b - 1] += 1
    else:
        ans[a - 1] += 1
        ans[b - 1] += 1

print(ans.count(0))

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

ans = 0
a = []
b = []

for i in range(m):
    a_i, b_i = map(int,input().split())
    a.append(a_i)
    b.append(b_i)

for i in range(n):
    h_i = [0]
    if i + 1 in a:
        h_i.append(h[b[a.index(i + 1)] - 1])
    if i + 1 in b:
        h_i.append(h[a[b.index(i + a)] - 1])
    if h[i] > max(h_i):
        ans += 1

print(ans)
Problem p02629 (python)

Fixed submission:
import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - 1 - (26 * (26 ** (group - 1) - 1)) // 25

    alphabet_num: List[int] = []
    alphabet: str = "abcdefghijklmnopqrstuvwxyz"
    temp = in_group_index
    for i in range(group - 1, -1, -1):
        alphabet_num.append(temp // 26 ** i)
        temp %= 26 ** i
    name_chars: List[str] = [alphabet[i] for i in alphabet_num]
    print("".join(name_chars))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - (26 * (26 ** (group - 1) - 1)) // 25

    alphabet_num: List[int] = []
    alphabet: str = "abcdefghijklmnopqrstuvwxyz"
    temp = in_group_index
    for i in range(group - 1, -1, -1):
        alphabet_num.append(temp // 26 ** i)
        temp %= 26 ** i
    else:
        alphabet_num[-1] -= 1
    name_chars: List[str] = [alphabet[i] for i in alphabet_num]
    print("".join(name_chars))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
from typing import List, NoReturn, Tuple


def main() -> NoReturn:
    n: int = int(input())
    # 0.9615384615384616 == 25 / 26
    group: int = math.ceil(math.log(0.9615384615384616 * n + 1, 26))
    in_group_index: int = n - (26 * (26 ** (group - 1) - 1)) // 25

    if in_group_index == 0:
        print("z" * (group - 1))
        return
    else:
        alphabet_num: List[int] = []
        alphabet: str = "abcdefghijklmnopqrstuvwxyz"
        temp = in_group_index
        for i in range(group - 1, -1, -1):
            alphabet_num.append(temp // 26 ** i)
            temp %= 26 ** i
        else:
            alphabet_num[-1] -= 1
        name_chars: List[str] = [alphabet[i] for i in alphabet_num]
        print("".join(name_chars))


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

Fixed submission:
def main():
  n = input()
  print("Yes" if n.count("7") > 0 else "No")
  

if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  n = input()
  if n.count(7) > 0:
    print("Yes")
  else:
    print("No")
  

if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  n = input()
  print("Yes" if n.count(7) > 0 else "No")
  

if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
def main():
  n = input()
  print("Yes" if n.count() > 0 else "No")
  

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

Fixed submission:
from fractions import gcd


def main():
  a, b = map(int, input().split())
  print(a * b // gcd(a, b))
  
  
if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
from fraction import gcd


def main():
  a, b = map(int, input().split())
  print(a * b // gcd(a, b))
  
  
if __name__ == "__main__":
  main()
Problem p02831 (python)

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


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


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

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline


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


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

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

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


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


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

Fixed submission:
def getCircleArea(r):
    return r * r


print(getCircleArea(int(input())))

Buggy submission (verdict: Runtime Error):
import math
import sys
 
 
def Knight():
    def check(d):
        if not ((d[0] % 3 == 0 and d[1] % 3 == 0) or (d[0] % 3 == 1 and d[1] % 3 == 2) or (d[0] % 3 == 2 and d[1] % 3 == 1)):
            print(0)
            sys.exit()
    d = list(map(int, input().split()))
    check(d)
 
    x = d[0]
    y = d[1]
    diff = x - y if x > y else y - x  # aとbの回数の差
    d2 = [x - diff, y - diff * 2] if x < y else [x - diff * 2, y - diff]
    r = d2[0] // 3
 
    def cmb(n, r, mod):
        r = min(r, n-r)
        return g1[n] * g2[r] * g2[n-r] % mod
 
    mod = 10**9+7  # 出力の制限
    N = x if x > y else y
    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)
 
    a = cmb(r*2+diff, r, mod)
 
    print(a)
 
 
Knight()
Problem p03208 (python)

Fixed submission:
import sys
import numpy as np
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N, K = readnums()
    h = np.sort(np.array([readint() for _ in range(N)]))
    ans = 0
    for i in range(N - K + 1):
        if not i:
            ans = h[i + K - 1] - h[i]
        else:
            ans = min(ans, h[i + K - 1] - h[i])

    print(ans)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import sys
import numpy as np
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N, K = readnums()
    h = np.sort(np.array([readint() for _ in range(N)]))
    ans = 0
    for i in range(N - K + 1):
        if not i:
            ans = h[i + 2] - h[i]
        else:
            ans = min(ans, h[i + 2] - h[i])

    print(ans)


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

Fixed submission:
import sys
import math
input = sys.stdin.readline
 
N = int(input())
a = int(math.sqrt(N))
 
A = 0
B = 0
for i in reversed(range(1, a + 1)):
  if not N % i:
    A = i
    B = N // A
    break
 
print(max(len(str(A)), len(str(B))))

Buggy submission (verdict: Runtime Error):
import sys
import math
input = sys.stdin.readline

N = int(input())
a = int(math.sqrt(N))

A = 0
B = 0
for i in reversed(range(1, a + 1)):
  if not N % i:
    A = i
    B = N // A
    break

print(max(len(str(A)), len(str(B)))
Problem p03221 (python)

Fixed submission:
N, M = map(int, input().split())
timeline = []
for i in range(M):
    P, Y = map(int, input().split())
    timeline.append((Y, P, i))
timeline.sort()
count = [0] * (N + 1)
number = [(0, 0)] * M
for y, p, i in timeline:
    count[p] += 1
    number[i] = (p, count[p])
for i in range(M):
    print('{:06}{:06}'.format(number[i][0], number[i][1]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
timeline = []
for i in range(M):
    P, Y = map(int, input().split())
    timeline.append((Y, P, i))
timeline.sort()
count = [0] * (N + 1)
number = [(0, 0)] * M
for y, p, i in timeline:
    count[p] += 1
    number[i] = (p, count[p])
for i in range(M):
    print(f'{number[i][0]:06}{number[i][1]:06}')
Problem p02571 (python)

Fixed submission:
S = input()
T = input()

N = len(T)
count = 0
count_list = []
index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N+1):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
        count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)

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

N = len(T)
count = 0
count_list = []

index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N+1):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
                count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)

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

N = len(T)
count = 0
count_list = []

index_list = []

if len(S)-len(T) != 0:
    for i in range(len(S)-N):
        index_list.append(S[0+i:N+i])

    for i in range(len(index_list)):
        count = 0
        for j in range(N):
            if index_list[i][j] == T[j]:
                count +=1
                count_list.append(count)
                
    print(N - max(count_list))
else:
    for i in range(N):
        if S[i] == T[i]:
            count += 1
    print(N - count)
Problem p02571 (python)

Fixed submission:
S = input()
T = input()
s1 = list(S)
t1 = list(T)
a = len(s1); b = len(t1)
z = []
for i in range(a-b+1):
    x = []
    y = 0
    for j in range(b):
        x.append(s1[i+j])
    for k in range(b):
        if t1[k]==x[k]:
            y += 1
    z.append(y)
print(b-max(z))

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
s1 = list(S)
t1 = list(T)
a = len(s1); b = len(t1)
z = []
for i in range(a-b):
    x = []
    y = 0
    for j in range(b):
        x.append(s1[i+j])
    for k in range(b):
        if t1[k]==x[k]:
            y += 1
    z.append(y)
print(b-max(z))
Problem p02572 (python)

Fixed submission:
import itertools
N = int(input())
a = list(map(int,input().split()))
a2 = itertools.accumulate(a)
b = [0]
b += list(a2)
s = 0
for i in range(N):
    s += (a[i] * (b[-1] - b[i+1]))
print(s % (10**9+7))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
t = [];s = 0
for i in range(N):
    for j in range(N):
        if i != j:
            if a[i]*a[j]<10**9+7:
                t.append(a[i]*a[j])
            else:
                t.append(a[i]%7*a%[j]%7)
for i in t:
    s += i
s = s//2
print(s%10**9+7)
Problem p02659 (python)

Fixed submission:
a, b = input().split()
A = int(a)
B = float(b)
B100 = round(100*B)

C=A*B100
print(str(C//100))

Buggy submission (verdict: Runtime Error):
import math

a, b = input().split()
A = int(a)
B = float(b)

print(int(ath.floor(A*B)))
Problem p02688 (python)

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

sweet=[0 for i in range(N+1)]

d=[]
A=[]
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int,input().split())))

for i in range(len(d)):
    for j in range(d[i]):
        sweet[A[i][j]]+=1

num=0
for i in range(1,len(sweet)):
    if sweet[i]==0:
        num+=1
print(num)

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

sweet=[0 for i in range(N+1)]

d=[]
A=[]
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int,input().split())))

for i in d:
    for j in range(i):
        for k in range(len(A[j])):
            sweet[A[j][k]]=1

num=0
for i in range(1,N):
    if sweet[i]==0:
        num+=1

print(num)
Problem p02729 (python)

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

pattern_o=(N-1)*N/2
pattern_e=(M-1)*M/2

print(int(pattern_o+pattern_e))

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

pattern_even=(N-1)*N/2
pattern_odd=(M-1)*M/2

return (pattern_even+pattern_odd)
Problem p02777 (python)

Fixed submission:
S,T=input().split()
A,B=map(int,input().split())
U=input()

if S==U:
    A-=1
else:
    B-=1

print(str(A)+" "+str(B))

Buggy submission (verdict: Runtime Error):
S,T=map(int,input().split())
A,B=map(int,input().split())
U=int(input())

if S==U:
    A-=1
else:
    B-=1

print(str(A)+" "+str(B))