qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# ABC143E - Travel by Car
def floyd_warshall(dist):
    """
    Compute the shortest paths of all pairs and modify dist.
    """
    for i in range(N):  # intermediate point
        for j, c2 in enumerate(dist[j][i] for j in range(N)):  #  source
            for k, (c1, c3) in enumerate(zip(dist[j], dist[i])):  # target
                if c2 + c3 < c1:
                    dist[j][k] = c2 + c3
                    

def main():
    # FW -> once more FW to edges <= L
    global N
    N, M, L, *X = map(int, open(0).read().split())
    ABC, ST = X[: 3 * M], X[3 * M + 1 :]
    INF = float("inf")
    dist = [[INF] * (N + 1) for _ in range(N + 1)]
    for i in range(N + 1):
        dist[i][i] = 0
    for v, u, cost in zip(*[iter(ABC)] * 3):
        dist[v][u] = dist[u][v] = cost
    dist = floyd_warshall(dist)

    # assume distance within L as 1 and compute the number of fueling
    modified_dist = [[1 if x <= L else INF for x in d] for d in dist]
    modified_dist = floyd_warshall(modified_dist)
    ans = [
        modified_dist[s][t] - 1 if modified_dist[s][t] != INF else -1
        for s, t in zip(*[iter(ST)] * 2)
    ]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()

Fixed code:
# ABC143E - Travel by Car
def floyd_warshall(dist):
    """
    Compute the shortest paths of all pairs and modify dist.
    """
    V = len(dist)
    for i in range(V):  # intermediate point
        for j, c2 in enumerate(dist[j][i] for j in range(V)):  #  source
            for k, (c1, c3) in enumerate(zip(dist[j], dist[i])):  # target
                if c2 + c3 < c1:
                    dist[j][k] = c2 + c3


def main():
    # FW -> once more FW to edges <= L
    N, M, L, *X = map(int, open(0).read().split())
    ABC, ST = X[: 3 * M], X[3 * M + 1 :]
    INF = float("inf")
    dist = [[INF] * (N + 1) for _ in range(N + 1)]
    for i in range(N + 1):
        dist[i][i] = 0
    for v, u, cost in zip(*[iter(ABC)] * 3):
        dist[v][u] = dist[u][v] = cost
    floyd_warshall(dist)

    # assume distance within L as 1 and compute the number of fueling
    modified_dist = [[1 if x <= L else INF for x in d] for d in dist]
    floyd_warshall(modified_dist)
    ans = [
        modified_dist[s][t] - 1 if modified_dist[s][t] != INF else -1
        for s, t in zip(*[iter(ST)] * 2)
    ]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()
Buggy code:
# ABC143E - Travel by Car
def floyd_warshall(dist):
    """
    Compute the shortest paths of all pairs and modify dist.
    """
    for i in range(N):  # intermediate point
        for j, c2 in enumerate(dist[j][i] for j in range(N)):  #  source
            for k, (c1, c3) in enumerate(zip(dist[j], dist[i])):  # target
                if c2 + c3 < c1:
                    dist[j][k] = c2 + c3


def main():
    # FW -> once more FW to edges <= L
    global N
    N, M, L, *X = map(int, open(0).read().split())
    ABC, ST = X[: 3 * M], X[3 * M + 1 :]
    A, B, C, S, T = ABC[::3], ABC[1::3], ABC[2::3], ST[::2], ST[1::2]
    INF = 1 << 60
    dist = [[INF] * (N + 1) for _ in range(N + 1)]
    for i in range(N + 1):
        dist[i][i] = 0
    for v, u, cost in zip(*[iter(ABC)] * 3):
        dist[v][u] = dist[u][v] = cost
    floyd_warshall(dist)

    # assume distance within L as 1 and compute the number of fueling
    modified_dist = [[1 if x <= L else INF for x in d] for d in dist]
    floyd_warshall(modified_dist)
    ans = [
        modified_dist[s][t] - 1 if modified_dist[s][t] != INF else -1
        for s, t in zip(*[iter(ST)] * 2)
    ]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()

Fixed code:
# ABC143E - Travel by Car
def floyd_warshall(dist):
    """
    Compute the shortest paths of all pairs and modify dist.
    """
    for i in range(N + 1):  # intermediate point
        for j, c2 in enumerate(dist[j][i] for j in range(N + 1)):  #  source
            for k, (c1, c3) in enumerate(zip(dist[j], dist[i])):  # target
                if c2 + c3 < c1:
                    dist[j][k] = c2 + c3
    return dist

def main():
    # FW -> once more FW to edges <= L
    global N
    N, M, L, *X = map(int, open(0).read().split())
    ABC, ST = X[: 3 * M], X[3 * M + 1 :]
    INF = float("inf")
    dist = [[INF] * (N + 1) for _ in range(N + 1)]
    for i in range(N + 1):
        dist[i][i] = 0
    for v, u, cost in zip(*[iter(ABC)] * 3):
        dist[v][u] = dist[u][v] = cost
    dist = floyd_warshall(dist)

    # assume distance within L as 1 and compute the number of fueling
    modified_dist = [[1 if x <= L else INF for x in d] for d in dist]
    modified_dist = floyd_warshall(modified_dist)
    ans = [
        modified_dist[s][t] - 1 if modified_dist[s][t] != INF else -1
        for s, t in zip(*[iter(ST)] * 2)
    ]
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()
Buggy code:
def slove():
    import sys
    input = sys.stdin.readline
    n, m, l = list(map(int, input().rstrip('\n').split()))
    w = [[10 ** 10] * n for _ in range(n)]
    wl = [[10 ** 10] * n for _ in range(n)]
    for i in range(m):
        a, b, c = list(map(int, input().rstrip('\n').split()))
        if c <= l:
            w[a - 1][b - 1] = c
            w[b - 1][a - 1] = c
    for i in range(n):
        for j in range(n):
            if i != j:
                for k in range(n):
                    w[i][j] = min(w[i][j], w[i][k] + w[k][j])
            else:
                w[i][j] = 0
    for i in range(n):
        for j in range(n):
            if i != j:
                if w[i][j] <= l:
                    wl[i][j] = 1
            else:
                wl[i][j] = 0
    for i in range(n):
        for j in range(n):
            if i != j:
                for k in range(n):
                    wl[i][j] = min(wl[i][j], wl[i][k] + wl[k][j])
            else:
                wl[i][j] = 0
    q = int(input().rstrip('\n'))
    for i in range(q):
        s, t = list(map(int, input().rstrip('\n').split()))
        print(wl[s-1][t-1]-1)



if __name__ == '__main__':
    slove()


Fixed code:
def slove():
    import sys
    input = sys.stdin.readline
    n, m, l = list(map(int, input().rstrip('\n').split()))
    INF = 10 ** 11
    w = [[INF] * n for _ in range(n)]
    wl = [[INF] * n for _ in range(n)]

    for i in range(n):
        w[i][i] = 0

    for i in range(m):
        a, b, c = list(map(int, input().rstrip('\n').split()))
        if c <= l:
            w[a - 1][b - 1] = c
            w[b - 1][a - 1] = c

    for i in range(n):
        for j in range(n):
            for k in range(n):
                w[j][k] = min(w[j][k], w[j][i] + w[i][k])

    for i in range(n):
        for j in range(n):
            if w[i][j] <= l:
                wl[i][j] = 1
    for i in range(n):
        for j in range(n):
            for k in range(n):
                wl[j][k] = min(wl[j][k], wl[j][i] + wl[i][k])

    q = int(input().rstrip('\n'))
    for i in range(q):
        s, t = list(map(int, input().rstrip('\n').split()))
        if wl[s-1][t-1] == INF:
            print(-1)
        else:
            print(wl[s-1][t-1] - 1)


if __name__ == '__main__':
    slove()
Buggy code:
def warshall_floyd(G):
    '''
    G: N * N Array (Adjacency matrix)
    ret: N * N Array (Minimum path)
    '''
    import copy
    ret = copy.deepcopy(G)
    for k in range(N):
        for i in range(N):
            for j in range(N):
                ret[i][j] = min(ret[i][j], ret[i][k] + ret[k][j])
    return ret


INF = 10 ** 10
N, M, L = map(int, input().split())

G = [[INF] * N for _ in range(N)]
for i in range(M):
    A, B, C = map(int, input().split())
    G[A - 1][B - 1], G[B - 1][A - 1] = C, C

MinG = warshall_floyd(G)
GL = [[1 if MinG[i][j] <= L else INF for j in range(N)] for i in range(N)]
MinGL = warshall_floyd(GL)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    print(MinGL[s - 1][t - 1] - 1)


Fixed code:
def warshall_floyd(G):
    '''
    G: N * N Array (Adjacency matrix)
    ret: N * N Array (Minimum path)
    '''
    import copy
    ret = copy.deepcopy(G)
    for k in range(N):
        for i in range(N):
            for j in range(N):
                ret[i][j] = min(ret[i][j], ret[i][k] + ret[k][j])
    return ret


INF = 10 ** 10
N, M, L = map(int, input().split())

G = [[INF] * N for _ in range(N)]
for i in range(M):
    A, B, C = map(int, input().split())
    G[A - 1][B - 1], G[B - 1][A - 1] = C, C

MinG = warshall_floyd(G)
GL = [[1 if MinG[i][j] <= L else INF for j in range(N)] for i in range(N)]
MinGL = warshall_floyd(GL)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    print(-1 if MinGL[s - 1][t - 1] == INF else MinGL[s - 1][t - 1] - 1)
Buggy code:
import sys
imput = sys.stdin.readline
def func(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])
    return d
N,M,L = map(int,input().split())
road = [[10**10]*N for i in range(N)]
for i in range(N):
    road[i][i] = 0
for i in range(M):
    a,b,c = map(int,input().split())
    road[a-1][b-1] = c
    road[b-1][a-1] = c
road = func(road)
ans = [[10**5]*N for i in range(N)]
for i in range(N):
    for j in range(N):
        if road[i][j] <= L:
            ans[i][j] = 1
ans = func(ans)
for i in range(int(input())):
    a,b = map(int,input().split())
    o = ans[a-1][b-1]
    if o == float('inf'):
        print(-1)
    else:
        print(o-1)
    


Fixed code:
import sys
imput = sys.stdin.readline
def func(d):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])
    return d
N,M,L = map(int,input().split())
road = [[10**10]*N for i in range(N)]
for i in range(N):
    road[i][i] = 0
for i in range(M):
    a,b,c = map(int,input().split())
    road[a-1][b-1] = c
    road[b-1][a-1] = c
road = func(road)
ans = [[10**5]*N for i in range(N)]
for i in range(N):
    for j in range(N):
        if road[i][j] <= L:
            ans[i][j] = 1
ans = func(ans)
for i in range(int(input())):
    a,b = map(int,input().split())
    o = ans[a-1][b-1]
    if o == 10**5:
        print(-1)
    else:
        print(o-1)
Buggy code:
n, m, l = map(int, input().split())

l1 = [[10 ** 15 for i in range(n)] for i in range(n)]
for i in range(n):
    l1[i][i] = 0

for _ in range(m):
    a, b, c = map(int, input().split())
    l1[a - 1][b - 1] = c
    l1[b - 1][a - 1] = c

for i in range(n):
    for j in range(n):
        for k in range(n):
            l1[i][j] = min(l1[j][k], l1[j][i] + l1[i][k])

l2 = [[10 ** 4 for i in range(n)] for i in range(n)]
for i in range(n):
    l2[i][i] = 0

for i in range(n):
    for j in range(n):
        if l1[i][j] <= l:
            l2[i][j] = 1

for i in range(n):
    for j in range(n):
        for k in range(n):
            l2[i][j] = min(l2[j][k], l2[j][i] + l2[i][k])

q = int(input())
lq = []
for _ in range(q):
    lq.append(list(map(int, input().split())))

for sq in lq:
    res = l2[sq[0] - 1][sq[1] - 1]
    if res == 10 ** 4:
        print(-1)
    else:
        print(res - 1)


Fixed code:
n, m, l = map(int, input().split())

l1 = [[10 ** 15 for i in range(n)] for i in range(n)]
for i in range(n):
    l1[i][i] = 0

for _ in range(m):
    a, b, c = map(int, input().split())
    l1[a - 1][b - 1] = c
    l1[b - 1][a - 1] = c

for i in range(n):
    for j in range(n):
        for k in range(n):
            l1[j][k] = min(l1[j][k], l1[j][i] + l1[i][k])

l2 = [[10 ** 4 for i in range(n)] for i in range(n)]
for i in range(n):
    l2[i][i] = 0

for i in range(n):
    for j in range(n):
        if l1[i][j] <= l:
            l2[i][j] = 1

for i in range(n):
    for j in range(n):
        for k in range(n):
            l2[j][k] = min(l2[j][k], l2[j][i] + l2[i][k])

q = int(input())
lq = []
for _ in range(q):
    lq.append(list(map(int, input().split())))

for sq in lq:
    res = l2[sq[0] - 1][sq[1] - 1]
    if res == 10 ** 4:
        print(-1)
    else:
        print(res - 1)
Buggy code:
from itertools import product, combinations

INF = float('inf')
def floyd_warshall(V, E):
    dist = {u: {v: INF for v in V} for u in V}
    for v in V:
        dist[v][v] = 0
        for u, c in E[v]: dist[v][u] = c
    for k in V:        
        for i, j in product(V, repeat=2):
            if dist[i][j] > dist[i][k] + dist[k][j]:
                dist[i][j] = dist[i][k] + dist[k][j]
    return dist

N, M, L = map(int, input().split())
V = list(range(N))
E = [[] for _ in V]
for _ in range(M):
    a, b, c = map(int, input().split())
    E[a-1].append((b-1, c))
    E[b-1].append((a-1, c))

dist = floyd_warshall(V, E)
E_charge = [[] for _ in V]
for u, v in combinations(V, 2):
    if dist[u][v] <= L: E_charge[u][v] = 1; E_charge[v][u] = 1;
charge = floyd_warshall(V, E_charge)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    n = charge[s-1][t-1]
    print(n - 1 if n != INF else -1)

Fixed code:
from itertools import product, combinations

INF = float('inf')
def floyd_warshall(E):
    N = len(E)
    dist = [[INF for _ in range(N)] for _ in range(N)]
    for v in range(N):
        dist[v][v] = 0
        for u, c in E[v]: dist[v][u] = c
    for k in range(N):        
        for i, j in product(range(N), repeat=2):
            if dist[i][j] > dist[i][k] + dist[k][j]:
                dist[i][j] = dist[i][k] + dist[k][j]
    return dist

N, M, L = map(int, input().split())
E = [[] for _ in range(N)]
for _ in range(M):
    a, b, c = map(int, input().split())
    E[a-1].append((b-1, c))
    E[b-1].append((a-1, c))
dist = floyd_warshall(E)

E_charge = [[] for _ in range(N)]
for u, v in combinations(range(N), 2):
    if dist[u][v] <= L:
        E_charge[u].append((v, 1))
        E_charge[v].append((u, 1))
charge = floyd_warshall(E_charge)

Q = int(input())
for _ in range(Q):
    s, t = map(int, input().split())
    n = charge[s-1][t-1]
    print(n - 1 if n != INF else -1)
Buggy code:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def WF(mat, N):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                mat[i][j] = min(mat[i][j], mat[i][k]+mat[k][j])
    return mat


N, M, L = map(int, input().split())
roads = [[float('inf')]*N for _ in [0]*N]
kyuyu = [[float('inf')]*N for _ in [0]*N]
for _ in range(M):
    a, b, c = map(int, input().split())
    roads[a-1][b-1] = c
    roads[b-1][a-1] = c

roads = WF(roads)
for i in range(N):
    for j in range(i+1, N):
        if roads[i][j] <= L:
            kyuyu[i][j] = 1
            kyuyu[j][i] = 1
kyuyu = WF(kyuyu)
Q = int(input())
for _ in range(Q):
    s, t = map(lambda x: int(x)-1, input().split())
    dist = kyuyu[s][t]
    if dist == float('inf'):
        print(-1)
    else:
        print(dist-1)


Fixed code:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def WF(mat, N):
    for k in range(N):
        for i in range(N):
            for j in range(N):
                mat[i][j] = min(mat[i][j], mat[i][k]+mat[k][j])
    return mat


N, M, L = map(int, input().split())
roads = [[float('inf')]*N for _ in [0]*N]
kyuyu = [[float('inf')]*N for _ in [0]*N]
for _ in range(M):
    a, b, c = map(int, input().split())
    roads[a-1][b-1] = c
    roads[b-1][a-1] = c

roads = WF(roads, N)
for i in range(N):
    for j in range(i+1, N):
        if roads[i][j] <= L:
            kyuyu[i][j] = 1
            kyuyu[j][i] = 1
kyuyu = WF(kyuyu, N)
Q = int(input())
for _ in range(Q):
    s, t = map(lambda x: int(x)-1, input().split())
    dist = kyuyu[s][t]
    if dist == float('inf'):
        print(-1)
    else:
        print(dist-1)
Buggy code:
n,m,L=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]
q=int(input())
ql=[list(map(int,input().split())) for i in range(q)]
distance=[[10**17]*n for i in range(n)]
for i in range(m):
  if l[i][2]<=L:
    distance[l[i][0]-1][l[i][1]-1]=l[i][2]
    distance[l[i][1]-1][l[i][0]-1]=l[i][2]
for i in range(n):
  for j in range(n):
    for k in range(n):
      distance[j][k]=min(distance[j][k],distance[j][i]+distance[i][k])

for i in range(q):
  if distance[ql[i][0]-1][ql[i][1]-1]<=10*18:
    print(distance[ql[i][0]-1][ql[i][1]-1]//L)
  else:
    print(-1)

Fixed code:
n,m,L=map(int,input().split())
l=[list(map(int,input().split())) for i in range(m)]
q=int(input())
ql=[list(map(int,input().split())) for i in range(q)]
distance=[[10**18]*n for i in range(n)]
for i in range(m):
  if l[i][2]<=L:
    distance[l[i][0]-1][l[i][1]-1]=l[i][2]
    distance[l[i][1]-1][l[i][0]-1]=l[i][2]
for i in range(n):
  for j in range(n):
    for k in range(n):
      distance[j][k]=min(distance[j][k],distance[j][i]+distance[i][k])

distance2=[[10**18]*n for i in range(n)]
for i in range(n):
  for j in range(n):
    if distance[i][j]<=L:
      distance2[i][j]=1
      distance2[j][i]=1
for i in range(n):
  for j in range(n):
    for k in range(n):
      distance2[j][k]=min(distance2[j][k],distance2[j][i]+distance2[i][k])

for i in range(q):
  if distance2[ql[i][0]-1][ql[i][1]-1]>=10**18:
    print(-1)
  else:
    print(distance2[ql[i][0]-1][ql[i][1]-1]-1)
Buggy code:
import sys

def solve():
	input=sys.stdin.readline
	n, m, l = map(int, input().split())
	edge = [[] for _ in range(n)]
	for _ in range(m):
		a, b, c = map(int, input().split())
		if c <= l:
			edge[a-1].append((c, b-1))
			edge[b-1].append((c, a-1))
	inf = 10 ** 20
	dist = [[inf for _ in range(n)]for i in range(n)]
	for i in range(n):
		dist[i][i]=0
		for c, b in edge[i]:
			dist[i][b]=c
			
	for k in range(n):
		for i in range(n):
			for j in range(n):
				dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j])
				
	dist2 = [[n+50 for j in range(n)] for i in range(n)]
	for i in range(n):
		dist2[i][i] = 0
		for j in range(i+1, n):
			if dist[i][j] <= l:
				dist2[i][j] = 1
				dist2[j][i] = 1
	for k in range(n):
		for i in range(n):
			for j in range(n):
				dist2[i][j] = min(dist2[i][k] + dist2[k][j])
	q = int(input())		
	for i in range(q):
		s, t = map(int, input().split())
		print(dist2[s-1][t-1] - 1)
	return 0
	
if __name__ == '__main__':
	solve()

Fixed code:
import sys

def solve():
	input=sys.stdin.readline
	n, m, l = map(int, input().split())
	edge = [[] for _ in range(n)]
	for _ in range(m):
		a, b, c = map(int, input().split())
		if c <= l:
			edge[a-1].append((c, b-1))
			edge[b-1].append((c, a-1))
	inf = 10 ** 20
	dist = [[inf for _ in range(n)]for i in range(n)]
	for i in range(n):
		dist[i][i]=0
		for c, b in edge[i]:
			dist[i][b]=c
			
	for k in range(n):
		for i in range(n):
			for j in range(n):
				dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j])
				
	dist2 = [[n+50 for j in range(n)] for i in range(n)]
	for i in range(n):
		dist2[i][i] = 0
		for j in range(i+1, n):
			if dist[i][j] <= l:
				dist2[i][j] = 1
				dist2[j][i] = 1
	for k in range(n):
		for i in range(n):
			for j in range(n):
				dist2[i][j] = min(dist2[i][k] + dist2[k][j], dist2[i][j])
	q = int(input())		
	for i in range(q):
		s, t = map(int, input().split())
		print(dist2[s-1][t-1] - 1 if dist2[s-1][t-1] < n+50 else -1)
	return 0
	
if __name__ == '__main__':
	solve()
Buggy code:
d, e = map(int, input().strip().split())
g = list(map(int, input().strip().split()))
print(d, e)
#print(g)
#total = 0
for i in g:
    if i >= e:
        total += 1
print(total)

Fixed code:
d, e = map(int, input().strip().split())
g = list(map(int, input().strip().split()))
#print(d, e)
#print(g)
total = 0
for i in g:
    if i >= e:
        total += 1
print(total)
Buggy code:
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))

print(sum([1 if K<=a else 0 for a in A])

Fixed code:
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
print(sum([1 if K<=a else 0 for a in A]))
Buggy code:
n,k=map(int,input().split())
l=list(map(int,input().split()))
c=0
for i in l:
  if l>=k:
    c+=1
print c

Fixed code:
n,k=map(int,input().split())
l=list(map(int,input().split()))
c=0
for i in l:
  if i>=k:
    c+=1
print(c)
Buggy code:
import numpy

N,K = [int(s) for s in input.split()]
heights = np.array([int(s) for s in input().split()])

sum(heights > K)

Fixed code:
import numpy as np
 
N,K = [int(s) for s in input().split()]
heights = np.array([int(s) for s in input().split()])
 
print(sum(heights >= K))
Buggy code:
N,K = [int(s) for s in inpput().split()]
heights = [int(s) for s in input().split()]

count = 0

for i in range(N):
  if heights[i] >= K:
    count+=1
    
print(count)

Fixed code:
N,K = [int(s) for s in input().split()]
heights = [int(s) for s in input().split()]
 
count = 0
 
for i in range(N):
  if heights[i] >= K:
    count+=1
    
print(count)
Buggy code:
n,k = map(int,input().split())
h = list(map(int,input().split()))
x = 0
for i in n:
  if h[i-1]>=k:
    x += 1
print(x)

Fixed code:
n,k = map(int,input().split())
h = list(map(int,input().split()))
x = 0
for i in range(n):
  if h[i-1]>=k:
    x += 1
print(x)
Buggy code:
N, K = map(int,input().split())
h = map(int,input().split())
count = 0
for i in range(N):
  if K <= h[i]:
    count = count + 1
  else:
    continue
    
print(count)

Fixed code:
N, K = map(int,input().split())
h = list(map(int,input().split()))
count = 0
for i in range(N):
  if K <= h[i]:
    count = count + 1
  else:
    continue
    
print(count)
Buggy code:
N,K=map(int,input().split())
h=list(input())
s=0
for i in range(N):
  if h[i]>=K:
    s+=1
print(s)    

Fixed code:
N,K=map(int,input().split())
h=list(map(int,input().split()))
s=0
for i in range(N):
    if h[i]>=K:
        s+=1
print(s)
Buggy code:
N,K = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
for x in h:
  if h >= K:
    ans += 1
print(ans)

Fixed code:
N,K = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
for x in h:
  if x >= K:
    ans += 1
print(ans)
Buggy code:
N, K = map(int, input().split())
h = list(map(int, input().split()))
h.sort()

def nibu(x, arr):
  if x <= arr[0]:
    return len(arr)
  if arr[-1] < x:
    return 0
  l = 0
  h = len(arr) - 1
  while h - l >1:
    m = (l + h) // 2
    if x < arr[m]:
      h = m
    else:
      l = m
  return len(arr) - h
print(nibu(K, h))



Fixed code:
N, K = map(int, input().split())
h = list(map(int, input().split()))
h.sort()

def nibu(x, arr):
  if x <= arr[0]:
    return len(arr)
  if arr[-1] < x:
    return 0
  l = 0
  h = len(arr) - 1
  while h - l >1:
    m = (l + h) // 2
    if x <= arr[m]:
      h = m
    else:
      l = m
  return len(arr) - h

print(nibu(K, h))
Buggy code:
import fileinput
for i, line in enumerate(fileinput.input()):
  if i == 0:
    N, K = map(int, line.strip().split())
  else:
    hs = map(int, line.strip().split())
    print(sum([1 for h in hs if h > K]))
    break


Fixed code:
import fileinput
for i, line in enumerate(fileinput.input()):
  if i == 0:
    N, K = map(int, line.strip().split())
  else:
    hs = map(int, line.strip().split())
    print(sum([1 for h in hs if h >= K]))
    break
Buggy code:
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))
print(sum([map(lambda x: 1 if x - k >= 0 else 0, h)]))


Fixed code:
n, k = list(map(int,input().split()))
h = list(map(int,input().split()))
print(sum(list(map(lambda x: 1 if x - k >= 0 else 0, h))))
Buggy code:
N, K = map(int, input(),split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    if i>K:
        ans +=1
print(ans)

Fixed code:
N, K = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
for i in h:
    if i >= K:
        ans +=1
print(ans)
Buggy code:
n, k = map(int, input())
array = list(map(int, input()))

goukei = 0
for i in range(len(array)):
	if array[i] >= k:
		goukei += 1

print(goukei)

Fixed code:
n, k = map(int, input().split())
array = list(map(int, input().split()))

goukei = 0
for i in range(len(array)):
	if array[i] >= k:
		goukei += 1

print(goukei)
Buggy code:
n, k = map(int, input().split())
h = list(map(int, input().split()))
num = 0
for i in range(n):
    if h[i] > k:
        num += 1
print(num)

Fixed code:
n, k = map(int, input().split())
h = list(map(int, input().split()))
num = 0
for i in range(n):
    if h[i] >= k:
        num += 1
print(num)
Buggy code:
N, K = map(int, input().split())
H = list(map(int, input()split())
num = 0
for i in H:
    if i >= K:
        num += 1

print(num)

Fixed code:
N, K = map(int, input().split())
H = list(map(int, input().split()))
num = 0
for i in H:
    if i >= K:
        num += 1

print(num)