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

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

H=list(map(int, input().split()))
A = [input().split() for l in range(m)]

li = []

for a,b in A:
    if H[int(a)-1]<H[int(b)-1]:
        li.append((a,0))
    elif H[int(a)-1]>H[int(b)-1]:
        li.append((b,0))
    else:
        li.append((a,0))
        li.append((b,0))


di=dict(li)
print(n-len(di))

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

H=list(map(int, input().split()))
A = [input().split() for l in range(n-1)]

li = []

for a,b in A:
    if H[int(a)-1]<H[int(b)-1]:
        li.append((a,0))
    elif H[int(a)-1]>H[int(b)-1]:
        li.append((b,0))
    else:
        li.append((a,0))
        li.append((b,0))

di=dict(li)
print(n-len(di))

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

H=list(map(int, input().split()))
A = [input().split() for l in range(n-1)]

li = []

for a,b in A:
    if H[int(a)-1]<H[int(b)-1]:
        li.append((a,0))
    elif H[int(a)-1]>H[int(b)-1]:
        li.append((b,0))

di=dict(li)
print(n-len(di))

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

H=list(map(int, input().split()))
A = [input().split() for l in range(n-1)]

li = []

for a,b in A:
    if H[int(a)-1]<H[int(b)-1]:
        li.append((a,0))
    else:
        li.append((b,0))

di=dict(li)
print(n-len(di))
Problem p02699 (python)

Fixed submission:
a = list(map(int,input().split()))
s=a[0]
w=a[1]

if s<=w:
    print("unsafe")
else:
    print("safe")

Buggy submission (verdict: Runtime Error):
s = input()
a = [int(c) for c in s]

b=""
count=0

for i in range(len(a)):
    for j in range(i,len(a)):
        for k in range(i,j+1):
            b += str(a[k])
        #print(b)
        if int(b)%2019 == 0:
            count+=1
        b=""

print(count)

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

mydic={"",0}

for i in range(n):
    a=input()
    mydic.update(a)

#print(mydic)
print(len(mydic)-2)
Problem p03208 (python)

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

H = []
for i in range(N):
    H.append(int(input()))

H.sort()
ans = 10**9
for i in range(N-K+1):
    ans = min(ans, H[i+K-1]-H[i])

print(ans)

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

inf = 10*9
H = [inf]*inf
for i in range(N):
    H[i] = int(input())

H.sort()
ans = inf
for i in range(N):
    ans = min(ans, H[i+K-1]-H[i])

print(ans)
Problem p03013 (python)

Fixed submission:
#dp
n,m  = map(int,input().split())
ln = [-1 for i in range(n +1)]
mod_1 = 10**9 + 7
for i in range(m):
    ln[int(input())] = 0
#print(ln)
for i in range(n+1):
    if ln[i] ==0:
        pass
    elif i == 0:
        ln[i] = 1
    elif i == 1:
        ln[i] = 1
    else:
        ln[i] = (ln[i-1] + ln[i-2]) % mod_1
#print(ln)
print(ln[-1])

Buggy submission (verdict: Runtime Error):
#dp
n,m  = map(int,input().split())
ln = [-1 for i in range(n +1)]
mod_1 = 10**9 + 7
for i in range(m):
    ln[int(input())] = 0

for i in range(n+1):
    if ln[i] ==0
        pass
    elif i == 0:
        ln[i] = 1
    elif i == 1:
        ln[i] = 1
    else:
        ln.append((ln[-1] + ln[-2]) % mod_1)
print(ln[-1])

Buggy submission (verdict: Runtime Error):
#dp
n,m  = map(int,input().split())
ln = [-1 for i in range(n +1)]
mod_1 = 10**9 + 7
for i in range(m):
    ln[int(input())] = 0
line = []
for i in range(n+1):
    if ln[i] ==0
        pass
    elif i == 0:
        ln[i] = 1
    elif i == 1:
        ln[i] = 1
    else:
        line.append((line[-1] + line[-2]) % mod_1)
print(line[-1])
Problem p02572 (python)

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

total = 0
before = 0
for i in range(len(As) - 1):
    if i == 0:
        total = total + As[i] * sum(As[i+1:])
        before = sum(As[i+1:])
    else:
        total = total + ((before - As[i]) * As[i])
        before = before - As[i]

total = total % (10**9 + 7)

print(int(total))

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

total = 0
before = 0
for i in range(len(As) - 1):
    if i == 0:
        total = total + As[i] * sum(As[i+1:])
        before = As[i] * sum(As[i+1:])
    else:
        total = total + (((before / As[i-1]) - As[i]) * As[i])
        before = (((before / As[i-1]) - As[i]) * As[i])

total = total % (10**9 + 7)

print(int(total))
Problem p02754 (python)

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

num_of_repetition = (N // (num_of_blue + num_of_red))
remainder_s = N % (num_of_blue + num_of_red)

count_b = num_of_blue * num_of_repetition + min(num_of_blue, remainder_s)

print(count_b)

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

num_of_repetition = (N // (num_of_blue + num_of_red))
remainder_s = N % (num_of_blue + num_of_red)
base_s ='b' * num_of_blue + 'r' * num_of_red
count_b = num_of_blue * num_of_repetition + base_s[0:remainder_s].count('b')

print(count_b)

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

num_of_repetition = (N // (num_of_blue + num_of_red)) + 1
S = ('b' * num_of_blue + 'r' * num_of_red) * num_of_repetition

print(S[0:N].count('b'))
Problem p02688 (python)

Fixed submission:
n,k = map(int,input().split())
nn = [0]*n
for _ in range(k):
    d = int(input())
    a = [int(i) for i in input().split()]
    for j in a:
        nn[j-1] += 1
c=0
for i in nn:
   if i==0:
       c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
nn = [0]*n
for _ in range(k):
    d = int(input())
    a = [int(i) for i in input().split()]
    for	j in a:
	nn[j-1]	+= 1
c=0
for i in nn:
   if i==0:
       c+=1
print(c)
Problem p02689 (python)

Fixed submission:
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
nn = [1]*n
for _ in range(m):
    a,b = map(int,input().split())
    if h[a-1] ==h[b-1]:
        nn[a-1]=0
        nn[b-1]=0
    elif h[a-1] < h[b-1]:
        nn[a-1]=0
    else:
        nn[b-1]=0

print(sum(nn))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
nn = [1]*n
for _ in range(m):
    a,b	= map(int,input().split())

    if h[a-1] <	h[b-1]:
		nn[a-1]=0
    else:
		nn[b-1]=0

print(sum(nn))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
nn = [1]*n
for _ in range(m):
    a,b	= map(int,input().split())

    if h[a-1] <	h[b-1]:
	nn[a-1]=0
    else:
	nn[b-1]=0

print(sum(nn))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
nn = [[-1]]*n

for i in range(m):
    a,b = map(int,input().split())
    nn[a-1].append(b-1)
    nn[b-1].append(a-1)
c=0
for i	in range(n):
    f=0
    for k in nn[i]:
	if k==-1:continue
        if h[i] < k:
            f=1
    if f==0:
	c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
h = [int(i) for i in input().split()]
nn = [[-1]]*n

for i in range(m):
    a,b = map(int,input().split())
    nn[a-1].append(b-1)
    nn[b-1].append(a-1)
c=0
for i	in range(n):
    f=0
    for k in nn[i]:
	if k==-1:continue
        if h[i] < k:
            f=1
    if f==0:
	c+=1
print(c)
Problem p02701 (python)

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]

import collections

c = collections.Counter(s)

print(len(c.keys()))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]

l = []
c=0
for i in s:
    if i not in l:
        l.append(i)
	c+=1
print(c)
Problem p02873 (python)

Fixed submission:
s = input()
b = s[0]
cou = 0


lis = []
for i in s:
    if b ==i:
        if i=='<':
            cou-=1
        else:
            cou+=1
    else:
        lis.append(cou)
        b = i
        if b=='<':
            cou =-1
        else:
            cou = 1
lis.append(cou)
l = len(lis)
sum = 0
if s[0]=='<':
    for i in range(0,l,2):
        if i+1 == l and (i+1)%2==1:
            a = abs(lis[i])
            sum += a*(a+1)//2
            break
        a = abs(lis[i])
        b = abs(lis[i+1])

        if a < b:
            sum += b*(b+1)//2
            sum += (a-1)*a//2
        else:
            sum += a*(a+1)//2
            sum += (b-1)*b//2
else:
    a = abs(lis[0])
    sum += a*(a+1)//2
    for i in range(1,l,2):
        if i+1 == l and (i+1)%2==0:
            a = abs(lis[i])
            sum += a*(a+1)//2
            break
        a = abs(lis[i])
        b = abs(lis[i+1])

        if a < b:
            sum += b*(b+1)//2
            sum += (a-1)*a//2
        else:
            sum += a*(a+1)//2
            sum += (b-1)*b//2

print(sum)

Buggy submission (verdict: Runtime Error):
s = input()
b = s[0]
cou = 0
if len(s)==2:
    if s[0]=='>' and s[1] =='<':
        print(2)
        exit()

lis = []
for i in s:
    if b ==i:
        if i=='<':
            cou-=1
        else:
            cou+=1
    else:
        lis.append(cou)
        b = i
        if b=='<':
            cou =-1
        else:
            cou = 1
lis.append(cou)
l = len(lis)
sum = 0

for i in range(0,l,2):
    if i+1 == l and (i+1)%2==1:
        a = abs(lis[i])
        sum += a*(a+1)//2
        break
    a = abs(lis[i])
    b = abs(lis[i+1])

    if a < b:
		sum += b*(b+1)//2
		sum += (a-1)*a//2
    else:
        sum += a*(a+1)//2
        sum += (b-1)*b//2        
print(sum)
Problem p02881 (python)

Fixed submission:
import numpy as np
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

a = np.sort(make_divisors(n))
#print(a)                                                                      
if len(a)//2==0:
    x = len(a)//2-1
else:
    x = len(a)//2

xx = a[x]
yy= n//xx

print(xx-1+yy-1)

Buggy submission (verdict: Runtime Error):
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
def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr

    # データの状態に左右されないためにrandom.choice()を用いることもある。      
    # ref = random.choice(arr)                                                 
    ref = arr[0]
    ref_count = 0

    for ele in arr:
        if ele < ref:
            left.append(ele)
        elif ele > ref:
            right.append(ele)
        else:
            ref_count += 1
    left = quick_sort(left)
    right = quick_sort(right)
    return left + [ref] * ref_count + right

a = quick_sort(make_divisors(n))

if len(a)//2==0:
    x = len(a)//2-1
else:
    x = len(a)//2
xx = a[x]
yy= n//xx

print(xx-1+yy-1)

Buggy submission (verdict: Runtime Error):
import sys
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
def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr

    # データの状態に左右されないためにrandom.choice()を用いることもある。      
    # ref = random.choice(arr)                                                 
    ref = arr[0]
    ref_count = 0

    for ele in arr:
        if ele < ref:
            left.append(ele)
        elif ele > ref:
            right.append(ele)
        else:
            ref_count += 1
    left = quick_sort(left)
    right = quick_sort(right)
    return left + [ref] * ref_count + right

a = quick_sort(make_divisors(n))
x = len(a)//2-1
y = x+1
xx = a[x]
yy= a[y]
print(xx-1+yy-1)
Problem p02987 (python)

Fixed submission:
S = input()

a = S[0]
b = 'b'
a_count = 0
b_count = 0

for i in S:
    if i==a:
        a_count += 1
    else:
        b = i
for i in S:
    if i==b:
        b_count +=1

if a_count == 2 and b_count == 2:
    print('Yes')
else:
    print('No')

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

a = S[0]
a_count = 0
b_count = 0

for i in S:
    if i==a:
        a_count += 1
    else:
        b = i
for i in S:
    if i==b:
        b_count +=1

if a_count == 2 and b_count == 2:
    print('Yes')
else:
    print('No')
Problem p03011 (python)

Fixed submission:
P,Q,R = map(int,input().split())

a = P + Q
b = Q + R
c = R + P

if b > a and c > a:
  print(a)
elif b > c:
  print(c)
else:
  print(b)

Buggy submission (verdict: Runtime Error):
P,Q,R = map(int,input().split())

a = P + Q
b = Q + R
c = R + P

if a > b and a > c:
  print('a')
elif b > c:
  print('b')
else
  print('c')
Problem p02596 (python)

Fixed submission:
k=int(input())
n=7
for i in range(k+1):
    if n%k==0:
        print(i+1)
        exit()
    n=(10*n+7)%k
print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2==0 or n%5==0:
  print(-1)
else:
  a = 7
  flag = 0
  while flag==0:
    if a%n==0:
      print(count+1)
      flag = 1
    else:
      count+=1
      a = a*10
      a = a+7
      a = a%n

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2==0 or n%5==0:
  print(-1)
else:
  a = 7
  flag = 0
  while flag==0:
    if a%n==0:
      print(count)
      flag = 1
    else:
      count+=1
      a = a*10
      a = a+7
      a = a%n
Problem p02659 (python)

Fixed submission:
from decimal import *
a,b = map(Decimal,input().split(' '))
print(int(a*b))

Buggy submission (verdict: Runtime Error):
from Decimal import *
a,b = map(Decimal,input().split())
print(int(a*b))
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
S1 = ''
S2 = ''
if N%2==1:
    print('No')
else:
    for i in range(N//2):
        S1 += S[i]
    for j in range(N//2,N):
        S2 += S[j]
    if S1==S2:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2==1:
    print('No')
else:
    for i in range(N//2):
        S1 += S[i]
    for j in range(N//2,N):
        S2 += S[j]
    if S1==S2:
        print('Yes')
    else:
        print('No')
Problem p02594 (python)

Fixed submission:
n = int(input())
if n>= 30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
wqydcgy
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])

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)

Buggy submission (verdict: Runtime Error):

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

max=0

A.insert(0, 0)
A = numpy.cumsum(A)
B.insert(0,0)
B = numpy.cumsum(B)

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)
Problem p02571 (python)

Fixed submission:
def main():
    s = input()
    t = input()
    ans = 100000
    for i in range(len(s) - len(t) + 1):
        sub = s[i:i+len(t)]
        tmp = 0
        for j in range(len(sub)):
            if sub[j] != t[j]:
                tmp += 1
        ans = min([ans, tmp])
    print(ans)


if __name__ == '__main__':
    main()

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

    common = 0
    max_common = 0
    for t_ind in range(len(t)):
        for char in s:
            if not common and char == t[t_ind]:
                common += 1
            elif char == t[common]:
                common += 1
            else:
                if common and common > max_common:
                    max_common = common
                common = 0
    print(len(t) - max_common)

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

Fixed submission:
def main():

    a, b = map(int, input().split())
    for k in range(1, b + 1):
        if a * k % b == 0:
            print(a * k)
            break
        else:
            continue

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
import math

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

def main():

    a, b = map(int, input().split())
    print(least_common_multiple(a, b))

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

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
for aa in a:
    A[int(aa)-1]+=1
for aaa in A:
    print(aaa)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
for aa in a:
    A[a]+=1
for aa in A:
    print(aa)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
for aa in a:
    A[a]+=1
for aa in A:
    print(aa)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
for aa in a:
    A[a]+=1
for aa in A:
    print(aa)
Problem p02570 (python)

Fixed submission:
import sys

D,T,S = [int(i) for i in sys.stdin.readline().split()]

if(S*T>=D):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
import sys

D,T,S = [int(i) for i in sys.stdin.readline()]

if(S*T>=D):
	print("Yes")
else:
	print("No")
Problem p02831 (python)

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) 
    
s,t = map(int,input().split())
d = s * t // gcd(s, t)
print(d)

Buggy submission (verdict: Runtime Error):
from math import gcd
s,t = map(int,input().split())
d = s * t // gcd(s, t)
print(d)
Problem p02832 (python)

Fixed submission:
from collections import deque
n = int(input())
a = list(map(int, input().split()))
a = deque(a)
d = 0
i = 1
for _ in range(n):
    b = a.popleft()
    if i == b:
        d +=1
        i += 1
        
print(n-d if d !=0 else -1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
j = 0
d = 0
c0 = 0
l = sorted(list(set(a)))
for i in l:
    if i == j+1:
        j = i
        if i in a[c0:]:
            for 
            c = a[c0:].index(i)+(n-len(a[c0:]))
        else:break
        if c >= c0:
            d += 1
            c0 = c
        else:break
    else:break
print(n-d if d !=0 else -1)
Problem p02881 (python)

Fixed submission:
n = int(input())
c = max([i for i in range(1,int(n**0.5+1)) if n%i==0])
print(c+n//c-2)

Buggy submission (verdict: Runtime Error):
a = int(input())
c = [j for j in range(1,int(a**0.5)) if a%j==0]
print((max(c)-1) + (a//max(c)-1))

Buggy submission (verdict: Runtime Error):
n = int(input())
c = max([i for i in range(1,int(n**0.5)) if n%i==0])
print(c+n//c-2)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = max([i for i in range(1,int(n**0.5)) if n%i==0])
print(c+n//c-2)
Problem p03013 (python)

Fixed submission:
n,m = map(int, input().split())
a = set([int(input()) for i in range(m)])
memo = [0]*(n+1)

memo[0] = 1
if 1 in a:
    memo[1] = 0
else:
    memo[1] = 1
for i in range(2,n+1):
    if i in a:
        continue
    memo[i] = (memo[i-1] + memo[i-2])%1000000007

print(memo[n])

Buggy submission (verdict: Runtime Error):
memo = [0]*10**6 #i番目の数列を格納するためのメモ
def fib(n):
    if n in a:
        return 0
    if n<=1:
        return 1 #0,1番目の数列はo,1
    if memo[n] != 0:
        return memo[n] #i番目の数列がmemoにある場合それを返す
    memo[n] = fib(n-1) + fib(n-2) #i番目の数列の計算
    return memo[n]

print(fib(i)%1000000007)

Buggy submission (verdict: Runtime Error):
i,m = map(int, input().split())
a = [int(input()) for i in range(m)]

memo = [0]*10**5 #i番目の数列を格納するためのメモ
def fib(n):
    if n in a:
        return 0
    if n<=1:
        return 1 #0,1番目の数列はo,1
    if memo[n] != 0:
        return memo[n] #i番目の数列がmemoにある場合それを返す
    memo[n] = fib(n-1) + fib(n-2) #i番目の数列の計算
    return memo[n]

print(fib(i)%1000000007)
Problem p03075 (python)

Fixed submission:
a = [int(input()) for i in range(6)]
for i in range(0,5):
    for j in range(0,5):
        if abs(a[i]-a[j]) > a[5]:
            print(":(")
            exit()
else:
    print("Yay!")

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(6)]
for i in range(0:4):
  if a[i+1]-a[i]>a[5]:
    print(":(")
else:
  print("Yay!")
Problem p03077 (python)

Fixed submission:
import math
n = int(input())
tra = [int(input()) for i in range(5)]
print(math.ceil(n/min(tra))+4)

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

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = [int(input()) for _ in range(n)]
print(math.ceil(n/min(a))+4)
Problem p03135 (python)

Fixed submission:
N,A = map(int, input().split())
print(N/A)

Buggy submission (verdict: Runtime Error):
N,A = map(int, input().split())
pritn(N/A)
Problem p03208 (python)

Fixed submission:
n,k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
c = 10**10
for i in range(n-k+1):
    c = min(h[i+k-1]-h[i],c)
print(c)

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
h = sorted([int(input()) for i in range(n)])
c = 10**10
for i in range(n-k+1):
    c = min(h[i+2]-h[i],c)
print(c)
Problem p03252 (python)

Fixed submission:
from collections import Counter
s=sorted(Counter(input()).values())
t=sorted(Counter(input()).values())
print("Yes" if s==t else "No")

Buggy submission (verdict: Runtime Error):
from collections import Counter
s = sorted(Counter(input()).values)
t = sorted(Counter(input()).values)
print("Yes" if s==t else "No")
Problem p03835 (python)

Fixed submission:
K, S = map(int, input().split())
c = 0
for i in range(K+1):
    for j in range(K+1):
        b = S - i - j
        if b <= K and b >= 0:
            c += 1
print(c)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())
c = 0
for i in range(K+1):
    for j in range(K+1):
        b = S - i - j
        if b <= k and b >= 0:
            c += 1
print(c)

Buggy submission (verdict: Runtime Error):
K, S = map(int, input().split())
c = 0
for i in range(K+1):
    for j in range(K+1):
        b = S - i - j
        if b <= k and b >= 0:
            c += 1
print(c)