Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
number = np.array([j for j in range(0, N, -1)])
new_ai = number + array_Ai
for i in range(len(Ai)):
    goukei += np.count_nonzero(new_ai == (-Ai[i] - i))
print(goukei)

Fixed submission:
import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
number = np.array([j for j in range(0, N, -1)])
number_1 = np.array([1 for k in range(-N)])
new_ai = number + array_Ai
new_ai = new_ai - number_1
for i in range(len(Ai)):
    new_ai = new_ai + number_1
    goukei += np.count_nonzero(new_ai == -Ai[i])
print(goukei)

Fixed submission:
import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)

Buggy python submission (verdict: Runtime Error):
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
number = np.array([j for j in range(0, N, -1)])
number_1 = np.array([1 for k in range(-N)])
new_ai = number + array_Ai
new_ai = new_ai - number_1
for i in range(len(Ai)):
    new_ai = new_ai + number_1
    goukei += np.count_nonzero(new_ai == -Ai[i])
print(goukei)

Fixed submission:
import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)

Buggy python submission (verdict: Runtime Error):
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
for i in range(len(Ai)):
    number = np.array([j + i for j in range(0, N, -1)])
    new_ai = number + array_Ai
    goukei += np.count_nonzero(new_ai == -Ai[i])
print(goukei)

Fixed submission:
import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
for i in range(len(Ai)):
    number = np.array([j + i for j in range(0, N, -1)])
    new_ai = number + array_Ai
    goukei += np.count_nonzero(new_ai == -Ai[i])
print(goukei)

Fixed submission:
import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)

Buggy python submission (verdict: Runtime Error):
import numpy as np
goukei = 0

N = int(input()) * (-1)
Ai = list(map(int, input().split()))
array_Ai = np.array(Ai)
for i in range(len(Ai)):
    number = np.array([j + i for j in range(0, N, -1)])
    new_ai = number + array_Ai
    goukei += np.count_nonzero(new_ai == -Ai[i])

print(goukei)

Fixed submission:
import collections
goukei = 0

N = int(input())
Ai = list(map(int, input().split()))
number = [j for j in range(1, N+1, 1)]
plus_Ai = [x + y for (x, y) in zip(Ai, number)]
minus_Ai = [x - y for (y, x) in zip(Ai, number)]
c = collections.Counter(plus_Ai)

for i in minus_Ai:
    goukei += c[i]
print(goukei)