Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# https://abc084.contest.atcoder.jp/tasks/abc084_d


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def main():
    p_l = primes(10**5)
    total = [0 for _ in range(10 ** 5 + 1)]
    for i in range(3, 10 ** 5 + 1, 2):
        if i in p_l and (i + 1) // 2 in p_l:
            total[i] = 1
    for i in range(3, 10 ** 5 + 1):
        total[i] += total[i - 1]

    # print(total[:10])
    Q = int(input())
    lrs = [list(map(int, input().split())) for _ in range(Q)]
    for lr in lrs:
        print(total[lr[1]] - total[lr[0]-1])


main()






Fixed submission:
# https://abc084.contest.atcoder.jp/tasks/abc084_d


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return is_prime


def main():
    p_l = primes(10**5)
    total = [0 for _ in range(10 ** 5 + 1)]
    for i in range(3, 10 ** 5 + 1):
        if p_l[i] and p_l[(i + 1) // 2]:
            total[i] = 1 + total[i - 1]
        else:
            total[i] = total[i - 1]

    # print(total[:10])
    Q = int(input())
    lrs = [list(map(int, input().split())) for _ in range(Q)]
    for lr in lrs:
        print(total[lr[1]] - total[lr[0]-1])


main()

Buggy python submission (verdict: Time Limit Exceeded):
# https://abc084.contest.atcoder.jp/tasks/abc084_d

def is_prime(n):
    if n < 2: return False
    if n == 2: return True
    if n % 2 == 0: return False

    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1

    return True


def main():
    Q = int(input())
    lrs = [list(map(int, input().split())) for _ in range(Q)]
    p_l = [i for i in range(2, 10**5 + 1) if is_prime(i)]

    for lr in lrs:
        ans = 0
        for i in range(lr[0], lr[1] + 1, 2):
            ans += 1 if i in p_l and (i + 1) // 2 in p_l else 0
        print(ans)


main()






Fixed submission:
# https://abc084.contest.atcoder.jp/tasks/abc084_d


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return is_prime


def main():
    p_l = primes(10**5)
    total = [0 for _ in range(10 ** 5 + 1)]
    for i in range(3, 10 ** 5 + 1):
        if p_l[i] and p_l[(i + 1) // 2]:
            total[i] = 1 + total[i - 1]
        else:
            total[i] = total[i - 1]

    # print(total[:10])
    Q = int(input())
    lrs = [list(map(int, input().split())) for _ in range(Q)]
    for lr in lrs:
        print(total[lr[1]] - total[lr[0]-1])


main()
Buggy python submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc077/tasks/arc084_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    ans = 0

    for b in B:
        i = bisect.bisect_left(A, b)
        j = bisect.bisect_right(C, b)

        ans += i * (N - j)

    print(ans)


if __name__ == '__main__':
    main()
# https://atcoder.jp/contests/abc077/tasks/arc084_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    ans = 0

    for b in B:
        i = bisect.bisect_left(A, b)
        j = bisect.bisect_right(C, b)

        ans += i * (N - j)

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc077/tasks/arc084_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))
    A.sort()
    B.sort()
    C.sort()

    ans = 0

    for b in B:
        i = bisect.bisect_left(A, b)
        j = bisect.bisect_right(C, b)

        ans += i * (N - j)

    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc074/tasks/abc074_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    A = int(input())
    print(N * N - a)

if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc074/tasks/abc074_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    A = int(input())
    print(N * N - A)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
print(input()[0:len(s):2])

Fixed submission:
# https://atcoder.jp/contests/abc072/tasks/abc072_a

import itertools
import collections
import bisect

def main():
    X, t = map(int, input().split())
    print(max(0, X - t))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc068/tasks/arc079_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    N, M = map(int, input().split())
    s_list = []
    g_list = []

    for _ in range(M):
        a, b = map(int, input().split())
        if a == 1:
            s_list.append(b)
        if b == N:
            g_list.append(a)

    for s in s_list:
        if s in g_list:
            print("POSSIBLE")
            exit()
    print("IMPOSSIBLE")


if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc068/tasks/arc079_a

import itertools
import collections
import bisect

def main():
    N, M = map(int, input().split())

    src = {}
    A = []
    B = []
    for _ in range(M):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)

        if a == 1:
            src[b] = 1

    for i in range(M):
        if A[i] in src and B[i] == N:
            print("POSSIBLE")
            exit()

    print("IMPOSSIBLE")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc067/tasks/abc067_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    A, B = map(int, input().split())
    if A % 3 == 0 or B % 0 == 0 or (A + B) % 3 == 0:
        print('Possible')
    else:
        print('Impossible')


if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc067/tasks/abc067_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    A, B = map(int, input().split())
    if A % 3 == 0 or B % 3 == 0 or (A + B) % 3 == 0:
        print('Possible')
    else:
        print('Impossible')


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
rings = list(map(int, input().split()))
print(sum([rings] - max([rings])))

Fixed submission:
rings = list(map(int, input().split()))
print(sum(rings) - max(rings))
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc065/tasks/arc076_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math
import heapq

def main():
    N, M = map(int, input().split())

    mod = 10**9 + 7

    if abs(N - M) > 1:
        print(0)
        exit()

    n = 1
    for i in range(1, N + 1):
        n *= i
    m = 1
    for i in range(1, M + 1):
        m *= i

    if N == M:
        print((n * m * 2) % mod)
    else:
        print((n * m) % mod)

if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc065/tasks/arc076_a

import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math
import heapq

def main():
    N, M = map(int, input().split())

    mod = 10**9 + 7

    if abs(N - M) > 1:
        print(0)
        exit()

    n = 1
    m = 1
    for i in range(1, N + 1):
        n = (n * i) % mod
    for i in range(1, M + 1):
        m = (m * i) % mod

    if N == M:
        print((n * m * 2) % mod)
    else:
        print((n * m) % mod)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
# https://atcoder.jp/contests/abc063/tasks/arc075_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    scores = []
    for _ in range(N):
        s = int(input())
        scores.append(s)

    ans = 0
    if sum(scores) % 10 != 0:
        ans = sum(scores)
    else:
        for i in range(1, len(scores)+1):
            for cand in itertools.combinations(scores, i):
                val = sum(cand)
                if val % 10 != 0:
                    ans = max(ans, val)

    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc063/tasks/arc075_a

import itertools
import collections
import bisect

def main():
    N = int(input())
    scores = []
    for _ in range(N):
        s = int(input())
        scores.append(s)

    ans = 0
    if sum(scores) % 10 != 0:
        ans = sum(scores)
    else:
        scores.sort()
        for c in scores:
            if c % 10 != 0:
                ans = sum(scores) - c
                break

    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# https://atcoder.jp/contests/abc060/tasks/abc060_a

import itertools
import collections
import bisect

def main():
    A, B, C = map(int, input().split())
    print('YES' if A[-1] == B[0] and B[-1] == C[0] else 'NO')

if __name__ == '__main__':
    main()


Fixed submission:
# https://atcoder.jp/contests/abc060/tasks/abc060_a

import itertools
import collections
import bisect

def main():
    A, B, C = input().split()
    print('YES' if A[-1] == B[0] and B[-1] == C[0] else 'NO')

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
S = input()


def is_composable(s):
    if len(s) == 0:
        return True

    if s.startswith("dreamer"):
        dream_s = s[5:]
        dreamer_s = s[7:]
        return is_composable(dream_s) or is_composable(dreamer_s)
    elif s.startswith("dream"):
        dream_s = s[5:]
        return is_composable(dream_s)
    elif s.startswith("eraser"):
        erase_s = s[5:]
        eraser_s = s[6:]
        return is_composable(erase_s) or is_composable(eraser_s)
    elif s.startswith("erase"):
        erase_s = s[5:]
        return is_composable(erase_s)
    else:
        return False


if len(S) > 0 and is_composable(S):
    print("YES")
else:
    print("NO")


Fixed submission:
S = input()

S = S[::-1]

dream = "maerd"
dreamer = "remaerd"
erase = "esare"
eraser = "resare"

if len(S) > 0:
    while len(S) > 0:
        if S.startswith(dream):
            S = S[len(dream):]
        elif S.startswith(dreamer):
            S = S[len(dreamer):]
        elif S.startswith(erase):
            S = S[len(erase):]
        elif S.startswith(eraser):
            S = S[len(eraser):]
        else:
            break
    if len(S) > 0:
        print("NO")
    else:
        print("YES")

else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
S = input()


def is_composable(s):
    if len(s) == 0:
        return True

    if s.startswith("dreamer"):
        dream_s = s[5:]
        dreamer_s = s[7:]
        return is_composable(dream_s) or is_composable(dreamer_s)
    elif s.startswith("dream"):
        dream_s = s[5:]
        return is_composable(dream_s)
    elif s.startswith("eraser"):
        erase_s = s[5:]
        eraser_s = s[6:]
        return is_composable(erase_s) or is_composable(eraser_s)
    elif S.startswith("erase"):
        erase_s = s[5:]
        return is_composable(erase_s)
    else:
        return False


if len(S) > 0 and is_composable(S):
    print("YES")
else:
    print("NO")


Fixed submission:
S = input()

S = S[::-1]

dream = "maerd"
dreamer = "remaerd"
erase = "esare"
eraser = "resare"

if len(S) > 0:
    while len(S) > 0:
        if S.startswith(dream):
            S = S[len(dream):]
        elif S.startswith(dreamer):
            S = S[len(dreamer):]
        elif S.startswith(erase):
            S = S[len(erase):]
        elif S.startswith(eraser):
            S = S[len(eraser):]
        else:
            break
    if len(S) > 0:
        print("NO")
    else:
        print("YES")

else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
s = list(input())
if s == "BBB":
print("NO")

elif s == "AAA":
print("NO")

else:
print("YES")

Fixed submission:
s = input()
if s == "BBB":
	print("No")
elif s == "AAA":
	print("No")
else:
	print("Yes")
Buggy python submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
print(math.ceil(x/y))

Fixed submission:
x,y = map(int,input().split())
if x >= 10:
	print(y)  
else:
	print(y+(100*(10-x)))

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x => 10:
	print(y)  
else:
	print(y+(100*(10-x)))

Fixed submission:
x,y = map(int,input().split())
if x >= 10:
	print(y)  
else:
	print(y+(100*(10-x)))

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input(),split())
print(y+100*(10-x))

Fixed submission:
x,y = map(int,input().split())
if x >= 10:
	print(y)  
else:
	print(y+(100*(10-x)))
Buggy python submission (verdict: Runtime Error):
s = list(input())
if s[o]==s[1] and s[1]==s[2] and s[0]==s[2]:
  print("No")
else:
  print("Yes")

Fixed submission:
x,y,z = map(int,input().split())	
if y == x and y == z and x == z:
  print("No")
elif  x != y and y != z and x != z:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
a,b = input()

if a>=10:
    print(b)
else:
    print(b+100*(10-a))


Fixed submission:
a,b=map(int,input().split())

if a>=10:
    print(b)
else:
    print(b+100*(10-a))

Buggy python submission (verdict: Runtime Error):
a,b = input()
a = int(a)
b = int(b)

if a>=10:
    print(b)
else:
    print(b+100*(10-a))


Fixed submission:
a,b=map(int,input().split())

if a>=10:
    print(b)
else:
    print(b+100*(10-a))
Buggy python submission (verdict: Runtime Error):
N = input()
List = [input().split()]


ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (p-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)


Fixed submission:
N = int(input())
List = [int(i) for i in input().split()]


ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (int(p)-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)

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

N = 7
List = [14,14,2,13,56,2,37]

ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (p-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)


Fixed submission:
N = int(input())
List = [int(i) for i in input().split()]


ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (int(p)-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)

Buggy python submission (verdict: Runtime Error):
N = input()
List = [int(i) for i in input().split()]



ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (p-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)


Fixed submission:
N = int(input())
List = [int(i) for i in input().split()]


ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (int(p)-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

def comb_count(n,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

n,a,b = map(int,input().split())



countlist = []

for i in range(1,n+1):
    if i == a or i == b:
        pass
    else:
        countlist.append(i)

result = 0
for i in range(len(countlist)):
    result += comb_count(n,countlist[i])

print(result%(10**9+7))


Fixed submission:
mod = 10**9+7
n,a,b = map(int,input().split())
ans = pow(2,n,mod)-1
comb1 = 1
for i in range(n-a+1,n+1):
    comb1 *= i
    comb1 %= mod
for i in range(1,a+1):
    comb1 *= pow(i,mod-2,mod)
    comb1 %= mod

comb2  = 1
for i in range(n-b+1, n+1):
    comb2 *= i
    comb2 %= mod
for i in range(1,b+1):
    comb2 *= pow(i,mod-2,mod)
    comb2 %= mod

ans -= (comb1+comb2)
ans %= mod
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
list = [int(i) for i in input().split()]

for i in range(n):
    if list[i] %2 == 0:
        if list[i]%3 == 0 or list[i] %5 == 0:
            continue
        else:
            print("DENIED")
            break
else:
    print("APPROVED")


Fixed submission:
n = int(input())
list = [int(i) for i in input().split()]

for i in range(n):
    if list[i] %2 == 0:
        if list[i]%3 == 0 or list[i] %5 == 0:
            continue
        else:
            print("DENIED")
            break
else:
    print("APPROVED")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

S = []
for i in range(N):
    S.append(input())

m = 0
ans = []
for i in range(N):
    if m < S.count(S[i]):
        ans = []
        ans.append(S[i])
        m = S.count(S[i])
    if m == S.count(S[i]):
        ans.append(S[i])

a = sorted(set(ans))

for i in a:
    print(i)


Fixed submission:
N = int(input())

S = {}
for i in range(N):
    s = input()
    if s not in S.keys():
        S[s] = 0
    S[s] += 1

m = 0
ans = []
for s, c in S.items():
    if c > m:
        ans = []
        ans.append(s)
        m = c
    elif c == m:
        ans.append(s)


for i in sorted(ans):
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

answer = 'YES'
for i in range(N):
    c = A.count(A[i])
    if c >= 2:
        answer = 'NO'
        break

print(answer)


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

answer = 'YES'
AA = sorted(A)
for i in range(N - 1):
    if AA[i] == AA[i + 1]:
        answer = 'NO'
        break

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

p = list(map(lambda x: (x + 1) / 2, P))

p, sp = [], []
for i in range(N):
    p.append((P[i] + 1) / 2)

for i in range(N - K + 1):
    sp.append(sum(p[:i + K]) - sum(p[:i]))

print('{:.10f}'.format(max(sp)))


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

p = [0]
for i in range(N):
    p.append(p[-1] + (P[i] + 1) / 2)

print(max(p[i+K] - p[i] for i in range(N-K+1)))

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

c = N - K + 1
dp = [0 for _ in range(c)]

for i in range(c):
    dp[i] = sum(map(lambda x: sum(range(1, int(x) + 1)) / x, P[i: i + K]))

print('{:.10f}'.format(max(dp)))


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

p = [0]
for i in range(N):
    p.append(p[-1] + (P[i] + 1) / 2)

print(max(p[i+K] - p[i] for i in range(N-K+1)))

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

c = N - K + 1
dp = [0 for _ in range(c)]

for i in range(c):
    dp[i] = sum(P[i:i + K])

n = dp.index(max(dp))

pp = sum(map(lambda x: sum(range(1, int(x) + 1)) / x, P[n: n + K]))

print('{:.10f}'.format(pp))


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

p = [0]
for i in range(N):
    p.append(p[-1] + (P[i] + 1) / 2)

print(max(p[i+K] - p[i] for i in range(N-K+1)))
Buggy python submission (verdict: Time Limit Exceeded):
H = int(input())

count = 0
while True:
    H //= 2
    count += 1
    if H == 1:
        break

total = 0
for n in range(count + 1):
    total += 2 ** n

print(total)


Fixed submission:
import math
H = int(input())

count = 0
count = int(math.log2(H))

total = 0
total = int((1 - (2**(count + 1)))/(1 - 2))
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

count = 0
for i in range(N):
  if all(list(map(lambda x: x >= P[i], P[:i]))):
  	count += 1
print(count)


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

count = 0
m = P[0]
for i in range(N):
  if (m >= P[i]):
    count += 1
    m = P[i]
print(count)

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

count = 0
for i in range(N):
  if all(list(map(lambda x: x >= P[i], P[:i]))):
  	count += 1
print(count)


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

count = 0
m = P[0]
for i in range(N):
  if (m >= P[i]):
    count += 1
    m = P[i]
print(count)

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

count = 0
for i in range(N):
  if not any([ P[i] >= j for j in P[:i]]):
    count += 1
print(count)


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

count = 0
m = P[0]
for i in range(N):
  if (m >= P[i]):
    count += 1
    m = P[i]
print(count)

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

count = 0
for i in range(N):
  if N == 1:
    count = 1
    break
  dame = False
  for j in range(i):
    if P[i] > P[j]:
      dame = True
      break
  if not dame:
    count += 1

print(count)

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

count = 0
m = P[0]
for i in range(N):
  if (m >= P[i]):
    count += 1
    m = P[i]
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = 0
for i in range(1, N):
  total += i

print(total)


Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
total = 0
for i in range(1, N):
  total += i
  
print(total)


Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
print(np.sum(np.arange(1, N, dtype='int32')))

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
ar = np.arange(1, N)
total = np.sum(ar)
print(total)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
ar = np.arange(1, N)
total = np.sum(ar)
print(total)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
total = 0
total = sum(range(1, N))
print(total)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
total = 0
for i in range(1, N):
  total += i
  
print(total)

Fixed submission:
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
total = sum(range(1, N))
  
print(total)