Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import jit

@jit
def solve(s):
    n = len(s)
    ans = 0
    now = 0
    mp = np.zeros(2019, np.int32)
    mp[0] += 1
    tmp = np.zeros(2019, np.int32)

    id = np.zeros(2019, np.int32)
    for i in range(2019):
        id[i] = i * 10 % 2019

    for c in s:
        now *= 10;
        now += ord(c) - ord("0")
        now %= 2019

        ans += mp[now]
        mp[now] += 1
        for i in range(2019):
            tmp[id[i]] = mp[i]
        for i in range(2019):
            mp[i] = tmp[i]

    print(ans)

s = input()
solve(s)


Fixed submission:
s = input()
n = len(s)
ans = 0
now = 0
mp = [0 for i in range(2019)]
mp[0] += 1
tmp = [0 for i in range(2019)]

id = [0 for i in range(2019)]
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import jit

@njit
def solve(s):
    n = len(s)
    ans = 0
    now = 0
    mp = np.zeros(2019, np.int)
    mp[0] += 1
    tmp = np.zeros(2019, np.int)

    id = np.zeros(2019, np.int)
    for i in range(2019):
        id[i] = i * 10 % 2019

    for c in s:
        now *= 10;
        now += ord(c) - ord("0")
        now %= 2019

        ans += mp[now]
        mp[now] += 1
        for i in range(2019):
            tmp[id[i]] = mp[i]
        for i in range(2019):
            mp[i] = tmp[i]

    print(ans)

s = input()
solve(s)


Fixed submission:
s = input()
n = len(s)
ans = 0
now = 0
mp = [0 for i in range(2019)]
mp[0] += 1
tmp = [0 for i in range(2019)]

id = [0 for i in range(2019)]
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import jit

@jit
def solve(s):
    n = len(s)
    ans = 0
    now = 0
    mp = np.zeros(2019, np.int)
    mp[0] += 1
    tmp = np.zeros(2019, np.int)

    id = np.zeros(2019, np.int)
    for i in range(2019):
        id[i] = i * 10 % 2019

    for c in s:
        now *= 10;
        now += ord(c) - ord("0")
        now %= 2019

        ans += mp[now]
        mp[now] += 1
        for i in range(2019):
            tmp[id[i]] = mp[i]
        for i in range(2019):
            mp[i] = tmp[i]

    print(ans)

s = input()
solve(s)


Fixed submission:
s = input()
n = len(s)
ans = 0
now = 0
mp = [0 for i in range(2019)]
mp[0] += 1
tmp = [0 for i in range(2019)]

id = [0 for i in range(2019)]
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)

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

s = input()
n = len(s)
ans = 0
now = 0
mp = np.zeros(2019, np.int)
mp[0] += 1
tmp = np.zeros(2019, np.int)

id = np.zeros(2019, np.int)
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)


Fixed submission:
s = input()
n = len(s)
ans = 0
now = 0
mp = [0 for i in range(2019)]
mp[0] += 1
tmp = [0 for i in range(2019)]

id = [0 for i in range(2019)]
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)

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

s = input()
n = len(s)
ans = 0
now = 0
mp = np.zeros(2019, np.int)
mp[0] += 1
tmp = np.zeros(2019, np.int)

id = np.zeros(2019, np.int)
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)


Fixed submission:
s = input()
n = len(s)
ans = 0
now = 0
mp = [0 for i in range(2019)]
mp[0] += 1
tmp = [0 for i in range(2019)]

id = [0 for i in range(2019)]
for i in range(2019):
    id[i] = i * 10 % 2019

for c in s:
    now *= 10;
    now += ord(c) - ord("0")
    now %= 2019

    ans += mp[now]
    mp[now] += 1
    for i in range(2019):
        tmp[id[i]] = mp[i]
    for i in range(2019):
        mp[i] = tmp[i]

print(ans)