Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    import numpy as np
    n, k = map(int, input().split())
    A = np.array(list(map(int, input().split())), dtype=np.int64)
    for m in range(k):
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1
        A = np.cumsum(B)[:-1]
        if np.all(A == n):
            break

    for a in A:
        print(a, end=" ")

resolve()


Fixed submission:
from numba import jit
import numpy as np

@jit
def resolve():
    n, k = map(int, input().split())
    A = np.array(list(map(int, input().split())), dtype=np.int64)
    for m in range(k):
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1
        A = np.cumsum(B)[:-1]
        if np.all(A == n):
            break

    for a in A:
        print(a, end=" ")

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, k = map(int, input().split())
    k = min(100, k)
    A = list(map(int, input().split()))
    for m in range(k):
        B = [0 for i in range(n + 1)]
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1

        for i in range(1, n):
            B[i] += B[i - 1]

        if A == B:
            break
        A = B[:n]

    for a in A:
        print(a, end=" ")

resolve()


Fixed submission:
from numba import jit
import numpy as np

@jit
def resolve():
    n, k = map(int, input().split())
    A = np.array(list(map(int, input().split())), dtype=np.int64)
    for m in range(k):
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1
        A = np.cumsum(B)[:-1]
        if np.all(A == n):
            break

    for a in A:
        print(a, end=" ")

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    for m in range(k):
        B = [0 for i in range(n + 1)]
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1

        for i in range(1, n):
            B[i] += B[i - 1]

        if A == B:
            break
        A = B[:n]

    for a in A:
        print(a, end=" ")

resolve()

Fixed submission:
from numba import jit
import numpy as np

@jit
def resolve():
    n, k = map(int, input().split())
    A = np.array(list(map(int, input().split())), dtype=np.int64)
    for m in range(k):
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1
        A = np.cumsum(B)[:-1]
        if np.all(A == n):
            break

    for a in A:
        print(a, end=" ")

resolve()

Buggy python submission (verdict: Time Limit Exceeded):
import copy

def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    B = [0 for i in range(n)]
    for m in range(k):
        B = [1 for i in range(n)]
        for i in range(n):
            for j in range(A[i]):
                if 0 <= i - j - 1:
                    B[i - j - 1] += 1
                if i + j + 1 < n:
                    B[i + j + 1] += 1
        A = copy.deepcopy(B)

    for a in A:
        print(a, end=" ")

resolve()

Fixed submission:
from numba import jit
import numpy as np

@jit
def resolve():
    n, k = map(int, input().split())
    A = np.array(list(map(int, input().split())), dtype=np.int64)
    for m in range(k):
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            l = max(0, i - A[i])
            r = min(n, i + A[i] + 1)
            B[l] += 1
            if r < n:
                B[r] -= 1
        A = np.cumsum(B)[:-1]
        if np.all(A == n):
            break

    for a in A:
        print(a, end=" ")

resolve()