Buggy python submission (verdict: Runtime Error):
from numba import jit
import sys
input = sys.stdin.readline


@jit
N, K = map(int, input().split())
A = list(map(int, input().split()))

for _ in range(K):
    B = [0]*(N+1)
    for i, a in enumerate(A):
        B[max(0, i-a)] += 1
        B[min(N, i+a+1)] -= 1
    for j in range(1, N):
        B[j] += B[j-1]
    if A == B[:-1]:
        A = B[:-1]
        break
    A = B[:-1]

ans = ' '.join(list(map(str, A)))
print(ans)


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            bottom = max(0, i-a)
            top = min(N, i+a+1)
            # B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
            B[bottom] += 1
            B[top] -= 1
        for j in range(1, N):
            B[j] += B[j-1]

        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = max(0, i-a)
            top = min(N, i+a+1)
            # B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
            B[bottom] += 1
            if top < N:
                B[top] -= 1
        for j in range(1, N):
            B[j] += B[j-1]

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

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

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


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

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = max(0, i-a)
            top = min(N, i+a+1)

            # B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
            B[bottom] += 1
            B[top] -= 1
        for j in range(1, N):
            B[j] += B[j-1]

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

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = i - a
            top = i + a + 1
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
        if A == B:
            A = B
            break
        A = B[:]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = np.zeros(N)
        for i, a in enumerate(A):
            bottom = int(i - a)
            top = int(i + a + 1)
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] += np.ones(top-bottom)
        A = B[:]

    ans = ' '.join(list(map(str, map(int, A))))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = i - a
            top = i + a + 1
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
        A = B[:]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = np.zeros(N)
        for i, a in enumerate(A):
            bottom = i - a
            top = i + a + 1
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] += np.ones(top-bottom)
        A = list(map(int, B))

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = np.zeros(N)
        for i, a in enumerate(A):
            bottom = i - a
            top = i + a + 1
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] += np.ones(top-bottom)
        A = list(map(int, list(B)))

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


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

    for _ in range(K):
        B = [0]*N
        for i, a in enumerate(A):
            bottom = i - a
            top = i + a + 1
            if bottom < 0:
                bottom = 0
            if top > N:
                top = N
            B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
        A = B[:]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

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

for _ in range(K):
    B = [0]*N
    for i, a in enumerate(A):
        bottom = i - a
        top = i + a + 1
        if bottom < 0:
            bottom = 0
        if top > N:
            top = N
        B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
    A = B[:]

ans = ' '.join(list(map(str, A)))
print(ans)


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for _ in range(K):
    B = [0]*N
    for i, a in enumerate(A):
        bottom = i - a
        top = i + a + 1
        if bottom < 0:
            bottom = 0
        if top > N:
            top = N
        B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))
    A = B[:]

ans = ' '.join(list(map(str, A)))
print(ans)


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

B = [0]*N
for i, a in enumerate(A):
    bottom = i-a
    top = i+a+1
    if bottom < 0:
        bottom = 0
    if top > N:
        top = N
    B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))

for _ in range(K):
    A = B[:]
    B = [0]*N
    for i, a in enumerate(A):
        bottom = i-a
        top = i+a+1
        if bottom < 0:
            bottom = 0
        if top > N:
            top = N
        B[bottom:top] = list(map(lambda x: x+1, B[bottom:top]))

A = list(map(str, A))
ans = ' '.join(A)
print(ans)


Fixed submission:
from numba import jit
import sys
input = sys.stdin.readline


@jit
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    for _ in range(K):
        B = [0]*(N+1)
        for i, a in enumerate(A):
            B[max(0, i-a)] += 1
            B[min(N, i+a+1)] -= 1
        for j in range(1, N):
            B[j] += B[j-1]
        if A == B[:-1]:
            A = B[:-1]
            break
        A = B[:-1]

    ans = ' '.join(list(map(str, A)))
    print(ans)


if __name__ == '__main__':
    main()