Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    ans = 0
    for i in range(N-1):
        for j in range(i+1, N):
            ans += A[i] * A[j] % mod

    print(ans % mod)


if __name__ == '__main__':
    main()


Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    l = [A[0]]
    for i in range(N-2):
        l.append(l[-1] + A[i+1])

    ans = 0
    for i in range(N-1):
        ans += l[i] * A[i+1] % mod

    print(ans % mod)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    K = INT()

    gcdf = lambda *numbers: reduce(gcd, numbers)
    ans = 0
    for i in range(K):
        for j in range(K):
            for k in range(K):
                ans += gcdf(i + 1, j + 1, k + 1)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    K = INT()

    gcdf = lambda *numbers: reduce(gcd, numbers)
    ans = 0
    for t in list(combinations_with_replacement(range(K), 3)):
        k = 3
        if t[0] == t[1] and t[1] == t[2] and t[2] == t[0]:
            k = 1
        elif t[0] != t[1] and t[1] != t[2] and t[2] != t[0]:
            k = 6

        ans += k * gcdf(t[0] + 1, t[1] + 1, t[2] + 1)

    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    K, N = MAP()
    A = LIST()

    lis = []
    for i in range(N-1):
        lis.append(A[i+1] - A[i])
    lis.append(K + A[0] - A[N-1])

    ans = INF
    for i in range(N-1):
        ans = min(ans, sum(lis[i:i+N-1]))
        
    ans = min(ans, sum(lis[N-1:]) + lis[0])
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    K, N = MAP()
    A = LIST()

    ans = INF
    for i in range(N):
        if i == 0:
            ans = A[i+N-1] - A[i] if A[i+N-1] - A[i] < ans else ans
        else:
            ans = K + A[(i+N-1)%N] - A[i] if K + A[(i+N-1)%N] - A[i] < ans else ans
    
    print(ans)
    

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import deque
from copy import deepcopy
INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
sys.setrecursionlimit(10 ** 9)


def main():
    H, W = MAP()
    c = [list(INPUT()) for _ in range(H)]

    C = []
    for i in range(H+2):
        tmpc = []
        for j in range(W+2):
            if i == 0 or i == H+1 or j == 0 or j == W+1: tmpc.append(0)
            else: tmpc.append(c[i-1][j-1])
        C.append(tmpc)

    sp = deque()
    for i in range(H+2):
        for j in range(W+2):
            if C[i][j] == ".": sp.append([i, j])
            elif C[i][j] == "#": C[i][j] = 0

    ans = 0
    while sp:
        copy_c = deepcopy(C)
        sy, sx = sp.popleft()
        copy_c[sy][sx] = 0
        d = [(1, 0), (-1, 0), (0, 1), (0, -1)]
        queue = deque([[sy, sx]])

        while queue:
            y, x = queue.popleft()
            for dy, dx in d:
                if copy_c[y+dy][x+dx] == ".":
                    copy_c[y+dy][x+dx] = copy_c[y][x] + 1
                    queue.append([y+dy, x+dx])

        tmp = -1
        for i in range(H+2):
            tmp = max(tmp, max(copy_c[i]))

        ans = max(tmp, ans)

    print(ans)


if __name__ == '__main__':
    main()

Fixed submission:
import sys
from string import ascii_lowercase

INPUT = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10 ** 9)


def main():
    C = INPUT()

    flag = False
    for s in ascii_lowercase:
        if flag:
            print(s)
            sys.exit()
        if s == C: flag = True


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)
INF = float('inf')


def main():
    N = INT()

    num = [i + 1 for i in range(ceil(sqrt(N)))]

    minimum = INF
    for i in num:
        if N % i == 0:
            temp = i + N//i
            if temp < minimum:
                minimum = temp

    print(minimum - 2)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from math import ceil, sqrt

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)
INF = float('inf')


def main():
    N = INT()

    num = [i + 1 for i in range(ceil(sqrt(N)))]

    minimum = INF
    for i in num:
        if N % i == 0:
            temp = i + N//i
            if temp < minimum:
                minimum = temp

    print(minimum - 2)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))
sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    H = LIST()

    D = ""
    for i in range(N-1):
        if H[i] >= H[i+1]: D += "o"
        else: D += "x"

    ans = 0
    for i in range(1, N):
        if "o"*i in D: ans += 1
        else: break

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))
sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    H = LIST()

    D = [0]
    idx = 0
    for i in range(N-1):
        if H[i] >= H[i+1]: D[idx] += 1
        else:
            idx += 1
            D.append(0)

    print(max(D))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))
sys.setrecursionlimit(10 ** 9)
 
 
def main():
    N = INT()
    H = LIST()
 
    ans = 0
    for i in range(N-1):
        cnt = 0
        for j in range(i, N-1):
            if H[j] >= H[j+1]: cnt += 1
            else: break
        if ans < cnt: ans = cnt
 
    print(ans)
 
 
if __name__ == '__main__':
    main()

Fixed submission:
import sys
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
LIST = lambda: list(map(int, INPUT().split()))
sys.setrecursionlimit(10 ** 9)


def main():
    N = INT()
    H = LIST()

    D = [0]
    idx = 0
    for i in range(N-1):
        if H[i] >= H[i+1]: D[idx] += 1
        else:
            idx += 1
            D.append(0)

    print(max(D))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
 
INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
 
sys.setrecursionlimit(10 ** 9)
 
 
def main():
    N = INT()
    S = [INPUT() for _ in range(N)]
    check = []
    alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
    count = 0

    for i in range(N):
        check.append([0] * 26)
        for j in range(10):
            for k in range(26):
                if S[i][j] == alphabet[k]:
                    check[i][k] += 1

    for i in range(N - 1):
        for j in range(i + 1, N):
            if check[i] == check[j]: count += 1

    print(count)
 
if __name__ == '__main__':
    main()

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    S = [INPUT() for _ in range(N)]

    l = []
    for s in S:
        tmp_l = []
        for c in s:
            tmp_l.append(ord(c))
        tmp_l = sorted(tmp_l)

        tmp_s = ""
        for n in tmp_l:
            tmp_s += chr(n)
        l.append(tmp_s)

    C = Counter(l)
    ans = 0
    for c in C.values():
        if c > 1:
            ans += factorial(c) // (factorial(c - 2) * factorial(2))

    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M = MAP()
    A = [INT() for i in range(M)]

    dp = [1] * (N + 1)
    for a in A:
        dp[a] = 0

    for i in range(N-1):
        if not i+2 in A:
            dp[i+2] = (dp[i] + dp[i+1]) % mod
        else:
            dp[i+2] = 0
     
    print(dp[N])



if __name__ == '__main__':
    main()

Fixed submission:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N, M = MAP()
    A = [INT() for i in range(M)]

    dp = [1] * (N + 1)
    for a in A:
        dp[a] = 0

    for i in range(N-1):
        dp[i+2] = dp[i+2] * (dp[i] + dp[i+1]) % mod
     
    print(dp[N])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
from scipy.ndimage.morphology import distance_transform_cdt
INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
sys.setrecursionlimit(10 ** 9)


def main():
    H, W = MAP()
    A = [INPUT() for _ in range(H)]

    A = np.array([[(Ai[j] != "#") for j in range(W)] for Ai in A])
    print(distance_transform_cdt(A, metric="taxicab").max())


if __name__ == '__main__':
    main()


Fixed submission:
import sys
import numpy as np
from scipy.ndimage.morphology import distance_transform_cdt
INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
sys.setrecursionlimit(10 ** 9)


def main():
    H, W = MAP()
    A = [INPUT() for _ in range(H)]
    A = np.array([[(Ai[j] != "#") for j in range(W)] for Ai in A])
    print(distance_transform_cdt(A, metric="taxicab").max())


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10 ** 9)


def main():
    S = INPUT()
    N = len(S)

    s = ["", ""]
    flag = True
    for i in range(N):
        s[0] += str(i%2)
        s[1] += str((i + 1)%2)

    cnt = [0, 0]
    for i in range(N):
        for j in range(2):
            if s[j][i] != S[i]: cnt[j] += 1

    print(cnt[0] if cnt[0] < cnt[1] else cnt[1])


if __name__ == '__main__':
    main()

Fixed submission:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10 ** 9)


def main():
    S = INPUT()
    N = len(S)

    s = ["", ""]
    for i in range(N):
        for j in range(2):
            s[j] += str((i + j)%2)

    cnt = [0, 0]
    for i in range(N):
        for j in range(2):
            if s[j][i] != S[i]: cnt[j] += 1

    print(cnt[0] if cnt[0] < cnt[1] else cnt[1])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)


def main():
    N, Q = MAP()
    S = INPUT()
    L = [1 if S[i:i+2] == "AC" else 0 for i in range(N-1)]

    ans = []
    for i in range(Q):
        l, r = MAP()
        ans.append(sum(L[l-1:r-1]))

    print(*ans)


if __name__ == '__main__':
    main()

Fixed submission:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)


def main():
    N, Q = MAP()
    S = INPUT()
    
    L = [0]
    for i in range(N-1):
        L.append(L[-1] + (1 if S[i:i+2] == "AC" else 0))

    ans = []
    for i in range(Q):
        l, r = MAP()
        ans.append(L[r-1] - L[l-1])

    print(*ans)


if __name__ == '__main__':
    main()

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

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)


def main():
    N, Q = MAP()
    S = INPUT()
    ans = []

    for i in range(Q):
        l, r = MAP()

        cnt = 0
        for j in range(l, r):
            if S[j-1:j+1] == "AC": cnt += 1

        ans.append(cnt)

    print(*ans)


if __name__ == '__main__':
    main()

Fixed submission:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())

sys.setrecursionlimit(10 ** 9)


def main():
    N, Q = MAP()
    S = INPUT()
    
    L = [0]
    for i in range(N-1):
        L.append(L[-1] + (1 if S[i:i+2] == "AC" else 0))

    ans = []
    for i in range(Q):
        l, r = MAP()
        ans.append(L[r-1] - L[l-1])

    print(*ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N, M = MAP()
    X = LIST()

    if M == 1:
        print(0)
        sys.exit()

    X = sorted(X)

    H = []
    heapify(H)
    for i in range(len(X)-1):
        heappush(H, (X[i+1] - X[i])*(-1))

    for i in range(N-1): heappop(H)

    print(sum(H)*(-1))


if __name__ == '__main__':
    main()

Fixed submission:
import sys
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N, M = MAP()
    X = LIST()

    if M == 1 or N >= M:
        print(0)
        sys.exit()

    X = sorted(X)

    H = []
    heapify(H)
    for i in range(len(X)-1):
        heappush(H, (X[i+1] - X[i])*(-1))

    for i in range(N-1): heappop(H)

    print(sum(H)*(-1))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import sys
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N, M = MAP()
    X = LIST()
    
    if M == 1:
        print(0)
        sys.exit()
        
    X = sorted(X)

    H = []
    heapify(H)
    for i in range(len(X)-1):
        heappush(H, (X[i+1] - X[i])*(-1))

    for i in range(N-1): heappop(H)
    
    print(sum(H)*(-1))


if __name__ == '__main__':
    main()

Fixed submission:
import sys
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
MAP = lambda: map(int, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))

sys.setrecursionlimit(10 ** 9)


def main():
    N, M = MAP()
    X = LIST()

    if M == 1 or N >= M:
        print(0)
        sys.exit()

    X = sorted(X)

    H = []
    heapify(H)
    for i in range(len(X)-1):
        heappush(H, (X[i+1] - X[i])*(-1))

    for i in range(N-1): heappop(H)

    print(sum(H)*(-1))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def INT(): return int(input())
def LIST(): return list(map(int, input().split()))
 
INF = float('inf')
 
 
def sad(A, b):
    s = 0
 
    for i, a in enumerate(A):
        s += abs(a - (b + i))
 
    return s
 
 
def main():
    N = INT()
    A = LIST()
    MA = max(A)
    m = INF
 
    for i in range(N):
        s = sad(A, MA-i)
        if s < m:
            m = s
 
    print(m)
 
 
if __name__ == '__main__':
    main()

Fixed submission:
def INT(): return int(input())

def main():
    N = INT()
    
    if N % 2 == 0:
        print(N)
    else:
        print(2*N)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def INT(): return int(input())

def main():
    N = INPUT()
    
    if N % 2 == 0:
        print(N)
    else:
        print(2*N)

if __name__ == '__main__':
    main()


Fixed submission:
def INT(): return int(input())

def main():
    N = INT()
    
    if N % 2 == 0:
        print(N)
    else:
        print(2*N)

if __name__ == '__main__':
    main()