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

Fixed submission:
from collections import defaultdict


def main():
    height, width, target_count = [int(x) for x in input().split()]
    count_by_height = defaultdict(int)
    count_by_width = defaultdict(int)
    bomb_is = set()
    for _ in range(target_count):
        bom_h, bom_w = [int(x) - 1 for x in input().split()]
        count_by_height[bom_h] += 1
        count_by_width[bom_w] += 1
        bomb_is.add((bom_h, bom_w))
    max_h = max(v for v in count_by_height.values())
    max_w = max(v for v in count_by_width.values())
    max_h_index = [i for i, x in count_by_height.items() if x == max_h]
    max_w_index = [i for i, x in count_by_width.items() if x == max_w]
    no_cross = any(
        (hh, ww) not in bomb_is for hh in max_h_index for ww in max_w_index)
    return max_h + max_w - (not no_cross)


if __name__ == '__main__':
    ans = main()
    print(ans)

Buggy submission (verdict: Runtime Error):
def main():
    height, width, target_count = [int(x) for x in input().split()]
    count_by_height = [0] * height
    count_by_width = [0] * width
    bomb_is = [[False] * width for _ in range(height)]
    for _ in range(target_count):
        bom_h, bom_w = [int(x) - 1 for x in input().split()]
        count_by_height[bom_h] += 1
        count_by_width[bom_w] += 1
        bomb_is[bom_h][bom_w] = True
    max_h, max_w = max(count_by_height), max(count_by_width)
    max_h_is = [i for i, x in enumerate(count_by_height) if x == max_h]
    max_w_is = [i for i, x in enumerate(count_by_width) if x == max_w]
    no_cross = any(not bomb_is[hh][ww] for hh in max_h_is for ww in max_w_is)
    return max_h + max_w - (not no_cross)


if __name__ == '__main__':
    ans = main()
    print(ans)
Problem p02624 (python)

Fixed submission:
def main():
    num = int(input())
    ans = 0

    for divisor in range(1, num + 1):
        quotient = num // divisor
        ans += (quotient + 1) * quotient * divisor // 2

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    num = int(input())
    gg = ((
        (quotient := num // divisor) + 1) * quotient * divisor // 2
        for divisor in range(1, num + 1))
    print(sum(gg))


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

Fixed submission:
from collections import deque
import math


def main():
    n = int(input())
    if n == 1:
        print('a')
        return
    digits = deque()
    alpha = ord('a') - 1
    maxex = int(math.log(n-1, 26))
    ex = 1
    for ex in range(1, maxex + 2):
        bb = pow(26, ex - 1)
        aa = bb * 26
        rem = n % aa // bb
        n -= bb * rem
        if rem == 0:
            if n == 0:
                break
            rem += 26
            n -= aa
        digits.appendleft(chr(alpha + rem))

    [print(d, end='') for d in digits]
    print()


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from collections import deque
import math


def main():
    n = int(input())
    digits = deque()
    alpha = ord('a') - 1
    maxex = int(math.log(n-1, 26))
    ex = 1
    zflag = False
    for ex in range(1, maxex + 2):
        bb = pow(26, ex - 1)
        aa = bb * 26
        rem = n % aa // bb
        n -= bb * rem
        if rem == 0:
            if n == 0:
                break
            rem += 26
            n -= aa
        digits.appendleft(chr(alpha + rem))

    [print(d, end='') for d in digits]
    print()


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
from collections import deque
import math


def main():
    n = int(input())
    digits = deque()
    alpha = ord('a') - 1
    maxex = int(math.log(n, 27))
    ex = 1
    for ex in range(1, maxex + 2):
        bb = pow(26, ex - 1)
        aa = bb * 26
        rem = n % aa // bb
        n -= bb * rem
        digits.appendleft(alpha + rem)
    if n != 0:
        digits.appendleft(alpha + n)

    [print(chr(d), end='') for d in digits]
    print()


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

Fixed submission:
from collections import defaultdict
import math


def ggg(a, b):
    """規約分数を作る。n/0, 0/n は n=1,-1 にして返す。"""
    if a == b == 0:
        return 0, 0

    denominator = math.gcd(a, b)
    x, y = a // denominator, b // denominator
    return x, y


def main():
    n = int(input())
    mod = 1000000007
    zeroes = 0
    counter = defaultdict(lambda: defaultdict(int))
    for _ in range(n):
        a, b = [int(x) for x in input().split()]
        x, y = ggg(a, b)

        if x == y == 0:
            zeroes += 1
            continue
        if y < 0:
            # quadrant III, IV -> I, II
            x, y = -x, -y

        if x <= 0:
            # round 90° from quadrant II to I
            x, y = y, -x
            counter[(x, y)][1] += 1
        else:
            counter[(x, y)][0] += 1

    ans = 1
    for v in counter.values():
        now = 1
        now += pow(2, v[0], mod) - 1
        now += pow(2, v[1], mod) - 1
        ans = ans * now % mod
    ans += zeroes
    ans -= 1  # choose no fish
    return ans % mod


if __name__ == '__main__':
    print(main())

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
import math


def main():
    n = int(input())
    mod = 1000000007
    zeroes = 0
    counter = defaultdict(lambda: defaultdict(int))
    for _ in range(n):
        a, b = [int(x) for x in input().split()]
        denominator = math.gcd(a, b)
        x, y = a // denominator, b // denominator

        if x == y == 0:
            zeroes += 1
            continue
        if y < 0:
            # quadrant III, IV -> I, II
            x, y = -x, -y

        if x <= 0:
            # round 90° from quadrant II to I
            x, y = y, -x
            counter[(x, y)][1] += 1
        else:
            counter[(x, y)][0] += 1

    ans = 1
    for v in counter.values():
        now = 1
        now += pow(2, v[0], mod) - 1
        now += pow(2, v[1], mod) - 1
        ans = ans * now % mod
    ans += zeroes
    ans -= 1  # choose no fish
    return ans % mod


if __name__ == '__main__':
    print(main())
Problem p02699 (python)

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

if int(a[0]) <= int(a[1]):
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
a = input().spolit()

if int(a[0]) > int(a[1]):
  print("safe")
else:
  print("unsafe")
Problem p02571 (python)

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

if(t in s):
    print(0)

result = [0] * ((len(s) - len(t)) + 1)
for i in range(len(s) - len(t) + 1):
    result[i] = len(t)
    for j in range(len(t)):
        if(s[i+j] == t[j]):
            result[i] -= 1
 
print(min(result))

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

if(t in s):
    print(0)

result = []
for i in range(len(s) - len(t)):
    result.append(len(t))
    for j in range(len(t)):
        if(s[i+j] == t[j]):
            result[i] -= 1

print(min(result))

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

result = []
for i in range(len(s) - len(t)):
    result.append(len(t))
    for j in range(len(t)):
        if(s[i+j] == t[j]):
            result[i] -= 1

print(min(result))
Problem p02596 (python)

Fixed submission:
def main():
    K = int(input())
    Kstr = str(K)
    
    if Kstr[-1] in ('0','2','4','6','8','5'):
        print(-1)
    else:
        if K%7 == 0:
            L = (9*K)/7
        else:
            L = 9*K
        S = 10
        for i in range(1,6000000):
            S = S%L
            if S == 1:
                print(i)
                break
            S = S*10
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    K = int(input())
    Kstr = str(K)
    
    if Kstr[-1] in ('0','2','4','6','8','5'):
        print(-1)
    else:
        if K%7 == 0:
            L = (9*K)/7
        else:
            L = 9*K
        S = 10
        for i in range(1,L):
            S = S%L
            if S == 1:
                print(i)
                break
            S = S*10
    
if __name__ == '__main__':
    main()
Problem p02623 (python)

Fixed submission:
def main():
    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])
        
    ans,j = 0,M
    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)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    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(N):
        b.append(b[i] + B[i])
        
    ans,j = 0,M
    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)
    
if __name__ == '__main__':
    main()
Problem p02659 (python)

Fixed submission:
def main():
    A,B = map(str,input().split())
    A = int(A)
    B = B.replace('.','')
    B = int(B)
    C = A*B
    print(C//100)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A,B = map(str,input().split())
    A = int(A)
    B = B.replace(',','')
    B = int(B)
    C = A*B
    print(C//100)
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    A,B = map(str,input().split())
    A = int(A)
    B.replace(',','')
    B = int(B)
    C = A*B
    print(C//100)
    
if __name__ == '__main__':
    main()
Problem p02688 (python)

Fixed submission:
N,K = map(int,input().split())
A = [[0 for j in range(K)]for i in range(K)]
B = [0 for j in range(N)]
S = 0
for i in range(K):
    d = int(input())
    A[i] = list(map(int,input().split()))
for i in range(K):
    for j in range(len(A[i])):
        for k in range(N):
            if A[i][j] == k+1:
                B[k] = 1
for i in range(N):
    if B[i] != 1:
        S += 1
print (S)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [[0 for j in range(100)]for i in range(100)]
B = [0 for j in range(N)]
S = 0
for i in range(K):
    d = int(input())
    A[i] = list(map(int,input().split()))
for i in range(100):
    for j in range(100):
        for k in range(N):
            if A[i][j] == k+1:
                B[k] = 1
for i in range(N):
    if B[i] != 1:
        S += 1
print (S)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [[0 for j in range(N)]for i in range(N)]
B = [0 for j in range(N)]
S = 0
for i in range(K):
    d = int(input())
    A[i] = list(map(int,input().split()))
for i in range(len(A)):
    for j in range(len(A[i])):
        for k in range(N):
            if A[i][j] == k+1:
                B[k] = 1
for i in range(N):
    if B[i] != 1:
        S += 1
print (S)
Problem p02597 (python)

Fixed submission:
import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
 
 
def main():
    N = int(input())
    S = input()
    l=0
    r=len(S)-1
    ans=0
    while(1):
        for i in range(l,len(S)):
            if S[i]=='W':
                l=i
                break
        for j in range(r,-1,-1):
            if S[j]=='R':
                r=j
                break
        if i<j:
            ans+=1
            l=i+1
            r=j-1
        else:
            break
    print(ans)

 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
 
 
def main():
    N,S = Input.split()
    print(N)
    N=int(N)
    l=0
    r=len(S)-1
    ans=0
    while(1):
        for i in range(l,len(S)):
            if S[i]=='W':
                l=i
                break
        for j in range(r,0,-1):
            if S[j]=='R':
                r=j
                break
        
        if i<j:
            ans+=1
            l=i+1
            r=j-1
        else:
            break
    print(ans)

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

Fixed submission:
import numpy as np
import math
import collections
import bisect
from difflib import SequenceMatcher


def main():
    N, M, K = map(int, input().split())

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

    cumsumA = np.cumsum(A)
    p = bisect.bisect_left(cumsumA, K + 0.1)
    time = cumsumA[p - 1]
    tmp = p
    ans = tmp

    cntA = 0
    import numpy as np


import math
import collections
import bisect
from difflib import SequenceMatcher


def main():
    N, M, K = map(int, input().split())

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

    cumsumA = np.cumsum(A)
    a = bisect.bisect_left(cumsumA, K + 0.1) - 1
    time = cumsumA[a]
    tmp = a + 1
    ans = tmp

    b = 0
    while(b < len(B)):
        #print(a, b, ans)
        if time + B[b] <= K:
            time += B[b]
            tmp += 1
            b += 1
            if tmp > ans:
                ans = tmp
        else:
            if a < 0:
                break
            time -= A[a]
            tmp += -1
            a += -1

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import collections
import bisect
from difflib import SequenceMatcher


def main():
    N, M, K = map(int, input().split())

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

    cumsumA = np.cumsum(A)
    p = bisect.bisect_left(cumsumA, K + 0.1)
    time = cumsumA[p - 1]
    tmp = p
    ans = tmp

    cntA = 0
    import numpy as np


import math
import collections
import bisect
from difflib import SequenceMatcher


def main():
    N, M, K = map(int, input().split())

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

    cumsumA = np.cumsum(A)
    a = bisect.bisect_left(cumsumA, K + 0.1)
    time = cumsumA[a - 1]
    tmp = a
    ans = tmp

    b = 0
    while(b < len(B)):
        if time + B[b] <= K:
            time += B[b]
            tmp += 1
            b += 1
            if tmp > ans:
                ans = tmp
        else:
            if a < 0:
                break
            time -= A[a]
            a += -1
            tmp += -1

    print(ans)


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

Fixed submission:
#import numpy as np
import math
import collections
import bisect


def main():
    a, b, c, d = map(int, input().split())

    dp0 = [[1 for i in range(d + 1)] for j in range(c + 1)]
    dp1 = [[0 for i in range(d + 1)] for j in range(c + 1)]
    for i in range(c + 1):
        for j in range(d + 1):
            if j < b or i < a:
                dp0[i][j] = 0
                dp1[i][j] = 0
    for i in range(a, c + 1):
        for j in range(b, d + 1):
            # print(i, j, dp[i][j])
            if a == i and b == j:
                continue
            dp0[i][j] = ((i * dp0[i][j - 1]) % 998244353 + dp1[i][j - 1]) % 998244353
            dp1[i][j] = (j * (dp0[i - 1][j] + dp1[i - 1][j]) % 998244353) % 998244353

    print((dp0[c][d] + dp1[c][d]) % 998244353)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import collections
import bisect
 
 
def main():
    a, b, c, d = map(int, input().split())
 
    dp = [[[1 for k in range(2)] for i in range(d + 1)] for j in range(c + 1)]
    for k in range(2):
        for i in range(c + 1):
            for j in range(d + 1):
                dp[i][j][1] = 0
                if j < b or i < a:
                    dp[i][j][k] = 0
 
    for i in range(a, c + 1):
        for j in range(b, d + 1):
            # print(i, j, dp[i][j])
            if a == i and b == j:
                continue
            dp[i][j][0] = ((i * dp[i][j - 1][0]) % 998244353 + dp[i][j - 1][1]) % 998244353
            dp[i][j][1] = (j * (dp[i - 1][j][0] + dp[i - 1][j][1]) % 998244353) % 998244353
 
    print((dp[c][d][0] + dp[c][d][1]) % 998244353)
 
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import collections
import bisect
 
 
def main():
    a, b, c, d = map(int, input().split())
 
    dp = [[[1 for k in range(2)] for i in range(d + 1)] for j in range(c + 1)]
    for k in range(2):
        for i in range(c + 1):
            for j in range(d + 1):
                dp[i][j][1] = 0
                if j < b or i < a:
                    dp[i][j][k] = 0
 
    for i in range(a, c + 1):
        for j in range(b, d + 1):
            # print(i, j, dp[i][j])
            if a == i and b == j:
                continue
            dp[i][j][0] = ((i * dp[i][j - 1][0]) % 998244353 + dp[i][j - 1][1]) % 998244353
            dp[i][j][1] = (j * (dp[i - 1][j][0] + dp[i - 1][j][1]) % 998244353) % 998244353
 
    print((dp[c][d][0] + dp[c][d][1]) % 998244353)
 
 
if __name__ == '__main__':
    main()
Problem p02594 (python)

Fixed submission:
X = int(input())
if X>=30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
X = int(input())
return X>=30
Problem p02597 (python)

Fixed submission:
# -*- coding: utf-8 -*-
 
N = int(input())
C = input()

ans = 0
i = -1
j = N
while( True ):
  
  i += 1
  while( i<j ):
    if( C[i] == 'W' ):
      break
    else:
      i += 1
  
  j -= 1
  while( j>i ):
    if( C[j] == 'R' ):
      break
    else:
      j -= 1
  
  if ( i<j ):
    ans += 1
  else:
    break

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
 
N = int(input())
C = input()

ans = 0
i = -1
j = N
while( True ):
  
  while( i<j ):
    i += 1
    if( C[i] == 'W' ):
      break
  
  while( j>i ):
    j -= 1
    if( C[j] == 'R' ):
      break
  
  if ( i<j ):
    ans += 1
  else:
    break

print(ans)
Problem p02580 (python)

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

countW = [0]*(W+1)
countH = [0]*(H+1)
bomb = []
for i in range(M):
    h, w = map(int, input().split())
    bomb.append((h, w))
    countH[h] += 1
    countW[w] += 1

maxW = max(countW)
maxH = max(countH)
ans = maxW + maxH - 1
countMaxW = countW.count(maxW)
countMaxH = countH.count(maxH)

sumz = 0
for i in range(M):
    h, w = bomb[i]
    if countH[h] == maxH and countW[w] == maxW:
        sumz += 1

if countMaxW*countMaxH > sumz:
    ans += 1
print(ans)

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

countW = {0:0}
countH = {0:0}
bomb = [[0]*(W+1) for _ in range(H+1)]
for i in range(M):
    h, w = map(int, input().split())
    bomb[h][w] += 1
    if h in countH.keys():
        countH[h] += 1
    else:
        countH[h] = 1
    if w in countW.keys():
        countW[w] += 1
    else:
        countW[w] = 1

sortedW = sorted(countW.items(), key=lambda x:x[1])
sortedH = sorted(countH.items(), key=lambda x:x[1])

ans = 0
szH = len(sortedH)
szW = len(sortedW)
found = False
for h in range(szH-1, 0, -1):
    if found: break
    hh, bh = sortedH[h]
    for w in range(szW-1, 0, -1):
        ww, bw = sortedW[w]
        nval = bh + bw - bomb[hh][ww]
        if ans < nval: ans = nval
        elif ans > nval:
            found = True
            break

print(ans)
Problem p02598 (python)

Fixed submission:
N, K = map(int, input().split())
logs = list(map(int, input().split()))
maxL = max(logs)

def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx

if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL
print(ans)

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

def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx

if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL
print(ans)

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

def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx

if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL
print(ans)
Problem p02624 (python)

Fixed submission:
N = int(input())

furui = [1]*(N+1)
ans = 1
for i in range(2, N+1):
    k = i
    while k <= N:
        furui[k] += 1
        k += i
    ans += furui[i]*i

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())

furui = np.zeros(N+1, dtype=float)
for i in range(1, N+1):
    furui[i::i] = furui[i::i]+1

for i in range(1, N+1):
    furui[i] = furui[i]*i

print(int(furui.sum()))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())

furui = np.zeros(N+1, dtype=float)
for i in range(1, N+1):
    furui[i::i] += 1

for i in range(1, N+1):
    furui[i] = furui[i]*i

print(int(furui.sum()))
Problem p02571 (python)

Fixed submission:
s, t = [input() for i in range(2)]
c = []
for i in range(len(s) - len(t) + 1):
  d = len(t)
  for a, b in zip(s[i:], t):
    if a == b:
      d -= 1
  c.append(d)
print(min(c))

Buggy submission (verdict: Runtime Error):
s, t = [input() for i in range(2)]
c = []
for i in range(len(s) - len(t)):
  d = 0
  for a, b in zip(s[i:i+len(t)], t):
    if a != b:
      d += 1
  c.append(d)
print(min(c))

Buggy submission (verdict: Runtime Error):
s, t = [input() for i in range(2)]
c = []
for i in range(len(s) - len(t)):
  d = len(t)
  for a, b in zip(s[i:i+len(t)], t):
    if a == b:
      d -= 1
  c.append(d)
print(min(c))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
  for j in range(i+1, n):
    b.append(a[i] % (10 ** 9 + 7) * (a[j] % (10 ** 9 + 7))
print(sum(b) % (10 ** 9 + 7))
Problem p02577 (python)

Fixed submission:
n = list(map(int, input()))
print("Yes" if sum(n) % 9 == 0 else "No")

Buggy submission (verdict: Runtime Error):
n = list(input())
a = 0
for i in n:
  a += i
  
if a % 9 == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = list(input())
print("Yes" if sum(n) % 9 == 0 else "No")
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())
print("safe" if s > w else "unsafe")

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split())
print("unsafe" s <= w else "safe")

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split())
print("safe" s > w else "unsafe")
Problem p02753 (python)

Fixed submission:
n = input()
print("No" if n.count("A") == 3 or n.count("B") == 3 else "Yes")

Buggy submission (verdict: Runtime Error):
print("No" if len(set(input()) == 1 else "Yes")