Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
M = 1000000007
N = int(input())
A = list(map(int, input().split()))

ans = 1
rgb = [0, 0, 0]
for i in range(N):
    c = rgb.count(A[i])
    p = rgb.index(A[i])
    ans *= c
    rgb[p] += 1

print(ans % M)

Fixed submission:
M = 1000000007
N = int(input())
A = list(map(int, input().split()))

ans = 1
rgb = [0, 0, 0]
for i in range(N):
    c = rgb.count(A[i])
    if c == 0:
        ans = 0
        break
    p = rgb.index(A[i])
    ans *= c
    rgb[p] += 1

print(ans % M)
Buggy python submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
    def find(self, x):
        if self.parent[x] == x:
            return x
        self.parent[x] = self.find(self.parent[x])
        return self.parent[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        self.parent[x] = y

def main():
    N, M = map(int, input().split())
    uf = UnionFind(N)
    for i in range(M):
        X, Y, Z = map(int, input().split())
        uf.union(X-1, Y-1)
    s = set()
    for i in range(N):
        s.add(uf.find(i))
    print(len(s))

if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    main()


Fixed submission:
import sys

class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
    def find(self, x):
        if self.parent[x] == x:
            return x
        self.parent[x] = self.find(self.parent[x])
        return self.parent[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        self.parent[x] = y

def main():
    N, M = map(int, input().split())
    uf = UnionFind(N)
    for i in range(M):
        X, Y, Z = map(int, input().split())
        uf.union(X-1, Y-1)
    s = set()
    for i in range(N):
        s.add(uf.find(i))
    print(len(s))

if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    main()

Buggy python submission (verdict: Runtime Error):
class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
    def find(self, x):
        if self.parent[x] == x:
            return x
        self.parent[x] = self.find(self.parent[x])
        return self.parent[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        self.parent[x] = y

def main():
    N, M = map(int, input().split())
    uf = UnionFind(N)
    for i in range(M):
        X, Y, Z = map(int, input().split())
        uf.union(X-1, Y-1)
    s = set()
    for i in range(N):
        s.add(uf.find(i))
    print(len(s))

if __name__ == "__main__":
    main()


Fixed submission:
import sys

class UnionFind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
    def find(self, x):
        if self.parent[x] == x:
            return x
        self.parent[x] = self.find(self.parent[x])
        return self.parent[x]
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        self.parent[x] = y

def main():
    N, M = map(int, input().split())
    uf = UnionFind(N)
    for i in range(M):
        X, Y, Z = map(int, input().split())
        uf.union(X-1, Y-1)
    s = set()
    for i in range(N):
        s.add(uf.find(i))
    print(len(s))

if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    main()
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left

INF = 2 * 10**10

A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
X = [int(input()) for _ in range(Q)]

for x in X:
    sr = bisect_left(S, x) 
    sl = sr -1
    if sr != len(S) and S[sr] == x:
        sl = sr
    tr = bisect_left(T, x)
    tl = tr - 1
    if tr != len(T) and T[tr] == x:
        tl = tr

    ll = INF if sl == -1 or tl == -1 else x - min(S[sl], T[tl])
    rr = INF if sr == len(S) or tl == len(T) else max(S[sr], T[tr]) - x
    lsrt = INF if sl == -1 or tr == len(T) else 2*(x-S[sl]) + (T[tr] - x)
    ltrs = INF if tl == -1 or sr == len(S) else 2*(x-T[tl]) + (S[sr] - x)
    rslt = INF if tl == -1 or sr == len(S) else 2*(S[sr] - x) + (x - T[tl])
    rtls = INF if sl == -1 or tr == len(T) else 2*(T[tr] - x) + (x - S[sl])

    ans = min(ll, rr, lsrt, ltrs, rslt, rtls)
    print(ans)

Fixed submission:
from bisect import bisect_left

INF = 2 * 10**10

A, B, Q = map(int, input().split())
S = [int(input()) for _ in range(A)]
T = [int(input()) for _ in range(B)]
X = [int(input()) for _ in range(Q)]
ans = []
for x in X:
    sr = bisect_left(S, x) 
    sl = sr -1
    if sr != len(S) and S[sr] == x:
        sl = sr
    tr = bisect_left(T, x)
    tl = tr - 1
    if tr != len(T) and T[tr] == x:
        tl = tr

    ll = INF if sl == -1 or tl == -1 else x - min(S[sl], T[tl])
    rr = INF if sr == len(S) or tr == len(T) else max(S[sr], T[tr]) - x
    lsrt = INF if sl == -1 or tr == len(T) else 2*(x-S[sl]) + (T[tr] - x)
    ltrs = INF if tl == -1 or sr == len(S) else 2*(x-T[tl]) + (S[sr] - x)
    rslt = INF if tl == -1 or sr == len(S) else 2*(S[sr] - x) + (x - T[tl])
    rtls = INF if sl == -1 or tr == len(T) else 2*(T[tr] - x) + (x - S[sl])

    ans.append(min(ll, rr, lsrt, ltrs, rslt, rtls))
print(*ans, sep='\n')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import copy

sys.setrecursionlimit(10**6)

m = [0,2,5,5,4,5,6,3,7,6]

def a_le_b(a, b):
    la, lb = len(a), len(b)
    if la == lb:
        for i in range(la):
            if a[i] < b[i]:
                return True
            elif a[i] > b[i]:
                return False
        return True
    return la < lb

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
for i in range(len(A)-1, 0, -1):
    for j in range(i-1, -1, -1):
        if m[A[i]] == m[A[j]]:
            del A[i]
            break
# print(A)
dp = [[] for _ in range(N+1)]

for i in range(N):
    if len(dp[i])==0 and i != 0: continue
    x = copy.copy(dp[i]) + [0]
    # print(x)
    for j in range(len(A)):
        ind = i + m[A[j]]
        if ind <= N:
            x[-1] = A[j]
            if a_le_b(dp[ind], x):
                dp[ind] = copy.copy(x)
# print(dp)
print(''.join(map(str, dp[-1])))


Fixed submission:
import sys
import copy

sys.setrecursionlimit(10**6)

m = [0,2,5,5,4,5,6,3,7,6]

def a_le_b(a, b):
    la, lb = len(a), len(b)
    if la == lb:
        for i in range(la):
            if a[i] < b[i]:
                return True
            elif a[i] > b[i]:
                return False
        return True
    return la < lb

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
for i in range(len(A)-1, 0, -1):
    for j in range(i-1, -1, -1):
        if m[A[i]] == m[A[j]]:
            del A[i]
            break
# print(A)
dp = [[] for _ in range(N+1)]

for i in range(N):
    if len(dp[i])==0 and i != 0: continue
    x = copy.copy(dp[i]) + [0]
    # print(x)
    for j in range(len(A)):
        ind = i + m[A[j]]
        if ind <= N:
            x[-1] = A[j]
            if a_le_b(dp[ind], x):
                dp[ind] = copy.copy(x)
# print(dp)
print(''.join(map(str, dp[-1])))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
struct _I { _I() {cin.tie(0);ios::sync_with_stdio(false);}} __I;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class F, class S> istream& operator >> (istream& s, pair<F, S>& p)
{ cin >> p.first >> p.second; return s;}
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_h(const vector<T>& c, int n=INT_MAX)
{ rep(i, min(n, (int)c.size())) cout << c[i] << (i==c.size()-1?"\n":" "); }
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}
#define D1(a) cout<<#a<<":"<<a<<"\n"
#define D2(a,b) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<endl 
#define D3(a,b,c) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<","<<#c<<":"<<c <<endl
#define D4(a,b,c,d) cout<<#a<<":"<<a<<","<<#b<<":"<<b<<","<<#c<<":"<<c<<","<<#d<<":"<<d<<endl 
#define MOD 1000000007

int main()
{
    ll N; cin >>N;
    vector<ll> h(N); cin >> h;
    
    vll dp(N+1, LLONG_MAX);
    dp[1] = 0;

    for (int i = 1; i < N; i++) {
        if (i + 1 <= N)
            dp[i+1] = min(dp[i+1], dp[i] + abs(h[i-1]- h[i]));
        if (i + 2 <= N)
            dp[i+2] = min(dp[i+2], dp[i] + abs(h[i-1]- h[i+1]));
    }

    cout << dp[N] << endl;
}


Fixed submission:
n = int(input())
h = list(map(int, input().split()))

inf = 2**63-1
dp = [inf] * (n+1)
dp[1] = 0

for i in range(1, n):
    if i+1 <= n:
        dp[i+1] = min(dp[i+1], dp[i] + abs(h[i+1-1]-h[i-1]))
    if i+2 <= n:
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i+2-1]-h[i-1]))

print(dp[n])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(float, input().split()))

dp = [[0.0] * (N+1) for _ in range(N+1)]

dp[0][0] = 1

for i in range(N):
    for j in range(i+1):
        dp[i+1][j] += dp[i][j] * (1-P[i])
        dp[i+1][j+1] += dp[i][j] * P[i]

ans = 0.0
for i in range(N//2+1, N+1):
    ans += dp[N][i]

print(ans)

Fixed submission:
N = int(input())
P = list(map(float, input().split()))

dp = [[0.0] * (N+1) for _ in range(N+1)]

dp[0][0] = 1

for i in range(N):
    for j in range(i+1):
        dp[i+1][j] += dp[i][j] * (1-P[i])
        dp[i+1][j+1] += dp[i][j] * P[i]

ans = 0.0
for i in range(N//2+1, N+1):
    ans += dp[N][i]

print(ans)

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

dp = [[0.0] * (N+1) for _ in range(N+1)]

dp[0][0] = 1

for i in range(1, N+1):
    for j in range(i+1):
        dp[i][j] = dp[i-1][j] * (1-P[i-1])
        if j > 0:
            dp[i][j] += dp[i-1][j-1] * P[i-1]

ans = 0.0
for i in range(N//2+1, N+1):
    ans += dp[N][i]

print(ans)

Fixed submission:
N = int(input())
P = list(map(float, input().split()))

dp = [[0.0] * (N+1) for _ in range(N+1)]

dp[0][0] = 1

for i in range(N):
    for j in range(i+1):
        dp[i+1][j] += dp[i][j] * (1-P[i])
        dp[i+1][j+1] += dp[i][j] * P[i]

ans = 0.0
for i in range(N//2+1, N+1):
    ans += dp[N][i]

print(ans)
Buggy python submission (verdict: Runtime Error):
	a=int(input())

    if a >= 400 and a < 600:
        print("8")
    elif a >= 600 and a < 800:
        print("7")
    elif a >= 800 and a < 1000:
        print("6")
    elif a >= 1000 and a < 1200:
        print("5")
    elif a >= 1200 and a < 1400:
        print("4")
    elif a >= 1400 and a < 1600:
        print("3")
    elif a >= 1600 and a < 1800:
        print("2")
    elif a >= 1800 and a < 2000:
        print("8")

Fixed submission:
a=int(input())

if a >= 400 and a < 600:
    print("8")
elif a >= 600 and a < 800:
    print("7")
elif a >= 800 and a < 1000:
    print("6")
elif a >= 1000 and a < 1200:
    print("5")
elif a >= 1200 and a < 1400:
    print("4")
elif a >= 1400 and a < 1600:
    print("3")
elif a >= 1600 and a < 1800:
    print("2")
elif a >= 1800 and a < 2000:
    print("1")
Buggy python submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
	n=n*i
	if(n>1000000000000000000):
		n=-1
		break
print(n)

Fixed submission:
x,y = map(int,input().split())	
print(x*y)

Buggy python submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
	n=n*i
	if(n>1000000000000000000):
		n=-1
		break
print(n)

Fixed submission:
x,y = map(int,input().split())	
print(x*y)
Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
    n=n*i
 
if(n>1000000000000000000):
    print("-1")
else:
    print(n)

Fixed submission:
a=int(input())
li = list(map(int,input().split()))
 
n=1
if(0 in li):
	print(0)
else:
	for i in li:
		n=n*i
		if(n>1000000000000000000):
			n=-1
			break
	print(n)

Buggy python submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))

n=1
for i in  list
    n*=n*list[i]

if(n>1000000000000000000):
    print("-1")
else:
    print(n)


Fixed submission:
a=int(input())
li = list(map(int,input().split()))
 
n=1
if(0 in li):
	print(0)
else:
	for i in li:
		n=n*i
		if(n>1000000000000000000):
			n=-1
			break
	print(n)

Buggy python submission (verdict: Runtime Error):
a=int(input())
li = list(map(int,input().split()))

n=1
for i in  range(list)
    n*=n*list[i]

if(n>1000000000000000000):
    print("-1")
else:
    print(n)


Fixed submission:
a=int(input())
li = list(map(int,input().split()))
 
n=1
if(0 in li):
	print(0)
else:
	for i in li:
		n=n*i
		if(n>1000000000000000000):
			n=-1
			break
	print(n)
Buggy python submission (verdict: Time Limit Exceeded):
def fact(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a = int(input())
li = []
li = fact(a)
count = 0
i = 0
dif = 1

while i < len(li):
    if a == 1:
        break
    
    if li[i][1] >= dif:
        count += 1
        li[i][1] -= dif
        dif += 1
    
    if li[i][1] <= 1:
        dif = 1
        i += 1
print(count)

Fixed submission:
def fact(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a = int(input())
li = []
li = fact(a)
count = 0
i = 0
dif = 1

while i < len(li):
    if a == 1:
        break
    
    if li[i][1] >= dif:
        count += 1
        li[i][1] -= dif
        dif += 1
    else:
        dif = 1
        i += 1
print(count)
Buggy python submission (verdict: Runtime Error):
from itertools import product

n = int(input())
def calc(i):
    xs = [a for a in range(1,int(i**0.5))]
    ys = [a for a in range(1,int(i**0.5))]
    zs = [a for a in range(1,int(i**0.5))]
    cnt = 0
    for x,y,z in list(product(xs,ys,zs)):
        if x**2+y**2+z**2+x*y+y*z+z*x == i:
            cnt += 1
    print(cnt)






for i in range(1, n+1):
    calc(i)

Fixed submission:
a, b, c = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    if i % c == 0:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import product

n = int(input())
def calc(i):
    xs = [a for a in range(1,int(i**0.5))]
    ys = [a for a in range(1,int(i**0.5))]
    zs = [a for a in range(1,int(i**0.5))]
    cnt = 0
    for x,y,z in list(product(xs,ys,zs)):
        if (i % 6 == 0) or (i % 6 == 5) or (i % 6 == 1):
            if x**2+y**2+z**2+x*y+y*z+z*x == i:
                cnt += 1
    print(cnt)






for i in range(1, n+1):
    calc(i)

Fixed submission:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
                ans[v]+=1
for i in range(n):
    print(ans[i+1])

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import product

n = int(input())
def calc(i):
    xs = [a for a in range(1,int(i**0.5))]
    ys = [a for a in range(1,int(i**0.5))]
    zs = [a for a in range(1,int(i**0.5))]
    cnt = 0
    for x,y,z in list(product(xs,ys,zs)):
        if x**2+y**2+z**2+x*y+y*z+z*x == i:
            cnt += 1
    print(cnt)






for i in range(1, n+1):
    calc(i)

Fixed submission:
n = int(input())
ans = [0 for _ in range(10050)]
for i in range(1,105):
    for j in range(1,105):
        for k in range(1,105):
            v = i*i+j*j+k*k+i*j+j*k+k*i;
            if v<10050:
                ans[v]+=1
for i in range(n):
    print(ans[i+1])
Buggy python submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
x = abs(a-b) / (v - w)
if v <= w:
    print('NO')

else:
    if x >= t:
        print('YES')
    else:
        print('NO')

Fixed submission:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if a <= b:
    total_a = a + v * t
    total_b = b + w * t
    if total_a >= total_b:
        print('YES')
    else:
        print('NO')
else:
    total_a = a - v * t
    total_b = b - w * t
    if total_a <= total_b:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Runtime Error):
a, b = map(input().split())
print(int(a) * int(b))

Fixed submission:
N = [int(i) for i in input().split(' ')]
print(N[0] * N[1])
Buggy python submission (verdict: Runtime Error):
from math import sin, radians, cos, sqrt
lst = [int(i) for i in input().split()]
A, B, H, M = tuple(lst)
angle = M * 6 - (H * 30 + M * 0.5)
if abs(angle) > 180:
  angle = 360 - abs(angle)
elif abs(angle) == 180:
  X = A + B
  print(X)
elif abs(angle) == 0:
  print(0)
else:
  angle = abs(angle)
  area = A * B * sin(radians(angle)) / 2
  co = sqrt(1 - sin(radians(angle)) ** 2)
  X = sqrt(A**2 + B**2 - 2*A*B*co)
  print(X)

Fixed submission:
hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
bon = 3
N = input()
r = int(N[-1])
if r in hon:
  print('hon')
elif r in pon:
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()
if len(S) >= K:
  print(S[:K], '...', sep='')
else:
  print(S)

Fixed submission:
hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
bon = 3
N = input()
r = int(N[-1])
if r in hon:
  print('hon')
elif r in pon:
  print('pon')
else:
  print('bon')

Buggy python submission (verdict: Runtime Error):
hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
bon = 3
N = int(input())
if N.pop() in hon:
  print('hon')
elif N.pop() in pon:
  print('pon')
else:
  print('bon')

Fixed submission:
hon = [2, 4, 5, 7, 9]
pon = [0, 1, 6, 8]
bon = 3
N = input()
r = int(N[-1])
if r in hon:
  print('hon')
elif r in pon:
  print('pon')
else:
  print('bon')
Buggy python submission (verdict: Runtime Error):
lst = [int(i) for i in input().rstrip().split('')]
c=0
for l in lst:
  if l == 1:
    c += 1
print(c)

Fixed submission:
N = input()
print(N.count('1'))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [str(input()) for _ in range(n)]
d = dict((l,s.count(l)) for l in set(s))
max = max(d.values())
k = [x for x, y in d.items() if y ==max]
k.sort()
for i in k:
    print(i)


Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s = str(input())
    if s in d.keys():
        d[s] += 1
    else:
        d[s] = 1
max = max(d.values())
k = [x for x, y in d.items() if y ==max]
k.sort()
for i in k:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations, product

n, m, q = map(int, input().split())
a = [0 for _ in range(q)]
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
d = [0 for _ in range(q)]

for i in range(q):
	a[i], b[i], c[i], d[i] = map(int, input().split())
	a[i] -= 1
	b[i] -= 1

max_score = 0
all_combs = product(range(1, m+1), repeat=n)
for comb in all_combs:
	is_sorted = True
	for i in range(1, n):
		if comb[i] - comb[i-1] < 0:
			is_sorted = False
			break
	if is_sorted:
		# print(comb)
		cur_score = 0
		for i in range(q):
			if comb[b[i]] - comb[a[i]] == c[i]:
				cur_score += d[i]
		# print("cur_score", cur_score)
		if cur_score > max_score:
			max_score = cur_score
			# print("new max", max_score)
		# print()

print(max_score)


Fixed submission:
n, m, q = map(int, input().split())
a = [0 for _ in range(q)]
b = [0 for _ in range(q)]
c = [0 for _ in range(q)]
d = [0 for _ in range(q)]

for i in range(q):
	a[i], b[i], c[i], d[i] = map(int, input().split())
	a[i] -= 1
	b[i] -= 1

def get_next(l):
	i = n-1
	while i > -1 and l[i] == m:
		i -= 1

	if i < 0:
		return -1
	else:
		l[i] += 1
		for j in range(i+1, n):
			l[j] = l[i]
	return l

max_score = 0
cur_seq = [1 for _ in range(n)]
while cur_seq != -1:
	cur_score = 0
	for i in range(q):
		if cur_seq[b[i]] - cur_seq[a[i]] == c[i]:
			cur_score += d[i]
	if cur_score > max_score:
		max_score = cur_score
	cur_seq = get_next(cur_seq)

print(max_score)
Buggy python submission (verdict: Runtime Error):
# for i in range(10):
# 	print( 10 ** i % 2019)



s = list(map(int, list(input())))
n = len(s)
MODULO = 2019

power = 1a
prefix_ = [0 for _ in range(n+1)]
for i in range(n-1, -1, -1):
	prefix_[i] = (prefix_[i+1] + power*s[i]) % MODULO
	power *= 10
	power %= MODULO

seen = {}
ans = 0
for item in prefix_:
	ans += seen.get(item, 0)
	seen[item] = seen.get(item, 0) + 1

# print(s)
# print("prefix_", prefix_)
# print("unique", len(set(prefix_)))
# print("all", len(prefix_))
print(ans)

Fixed submission:
# for i in range(10):
# 	print( 10 ** i % 2019)



s = list(map(int, list(input())))
n = len(s)
MODULO = 2019

power = 1
prefix_ = [0 for _ in range(n+1)]
for i in range(n-1, -1, -1):
	prefix_[i] = (prefix_[i+1] + power*s[i]) % MODULO
	power *= 10
	power %= MODULO

seen = {}
ans = 0
for item in prefix_:
	ans += seen.get(item, 0)
	seen[item] = seen.get(item, 0) + 1

# print(s)
# print("prefix_", prefix_)
# print("unique", len(set(prefix_)))
# print("all", len(prefix_))
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print(6-A-B)


Fixed submission:
A=int(input())
B=int(input())
print(6-A-B)
Buggy python submission (verdict: Runtime Error):
X=int(input())

if X >= 400 amd x <=599:
    print("8")
elif X >= 600 amd x <=799:
    print("7")
elif X >= 800 amd x <=999:
    print("6")
elif X >= 1000 amd x <=1199:
    print("5")
elif X >= 1200 amd x <=1399:
    print("4")
elif X >= 1400 amd x <=1599:
    print("3")
elif X >= 1600 amd x <=1799:
    print("2")
elif X >= 1800 amd x <=1999:
    print("1")

Fixed submission:
X=int(input())

if X >= 400 and X <=599:
    print("8")
elif X >= 600 and X <=799:
    print("7")
elif X >= 800 and X <=999:
    print("6")
elif X >= 1000 and X <=1199:
    print("5")
elif X >= 1200 and X <=1399:
    print("4")
elif X >= 1400 and X <=1599:
    print("3")
elif X >= 1600 and X <=1799:
    print("2")
elif X >= 1800 and X <=1999:
    print("1")