Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

h,n = [int(x) for x in stdin.readline().rstrip().split()]
a = [0]*n ;b = [0]*n

for i in range(n):
    a[i],b[i] = [int(x) for x in stdin.readline().rstrip().split()]

#最高で削られる可能性がある体力
H = max(a)

inf = 10**10

#体力をちょうどi削るために必要な最低の魔力
dp = [inf for _ in range(h+H+1)];dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j+a[i]] > dp[j] + b[i]:
            dp[j+a[i]] = dp[j] + b[i]

print(min(dp[h:]))

Fixed submission:
from sys import stdin

h,n = [int(x) for x in stdin.readline().rstrip().split()]
a = [0]*n
b = [0]*n

for i in range(n):
    a[i],b[i] = [int(x) for x in stdin.readline().rstrip().split()]

#最高で削られる可能性がある体力
H = max(a)

inf = 10**10

#体力をちょうどi削るために必要な最低の魔力
dp = [inf for _ in range(h+H+1)]
dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j+a[i]] > dp[j] + b[i]:
            dp[j+a[i]] = dp[j] + b[i]

print(min(dp[h:]))

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

h,n = [int(x) for x in stdin.readline().rstrip().split()]
a = [0]*n ;b = [0]*n

for i in range(n):
    a[i],b[i] = [int(x) for x in stdin.readline().rstrip().split()]

#最高で削られる可能性がある体力
H = max(a)

inf = 10**10

#体力をちょうどi削るために必要な最低の魔力
dp = [inf for _ in range(h+H+1)];dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j+a[i]] > dp[j] + b[i]:
            dp[j+a[i]] = dp[j] + b[i]

print(min(dp[h:]))

Fixed submission:
from sys import stdin

h,n = [int(x) for x in stdin.readline().rstrip().split()]
a = [0]*n
b = [0]*n

for i in range(n):
    a[i],b[i] = [int(x) for x in stdin.readline().rstrip().split()]

#最高で削られる可能性がある体力
H = max(a)

inf = 10**10

#体力をちょうどi削るために必要な最低の魔力
dp = [inf for _ in range(h+H+1)]
dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j+a[i]] > dp[j] + b[i]:
            dp[j+a[i]] = dp[j] + b[i]

print(min(dp[h:]))

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

h,n = [int(x) for x in stdin.readline().rstrip().split()]
a = [0]*n ;b = [0]*n

for i in range(n):
    a[i],b[i] = [int(x) for x in stdin.readline().rstrip().split()]

#最高で削られる可能性がある体力
H = max(a)

inf = 10**10

#体力をちょうどi削るために必要な最低の魔力
dp = [inf for _ in range(h+H+1)];dp[0] = 0

for i,j in zip(a,b):
    for k in range(h+1):
        if dp[k+i] > dp[k] + j:
            dp[k+i] = dp[k] + j

print(min(dp[h:]))

Fixed submission:
from sys import stdin

h,n = [int(x) for x in stdin.readline().rstrip().split()]
a = [0]*n
b = [0]*n

for i in range(n):
    a[i],b[i] = [int(x) for x in stdin.readline().rstrip().split()]

#最高で削られる可能性がある体力
H = max(a)

inf = 10**10

#体力をちょうどi削るために必要な最低の魔力
dp = [inf for _ in range(h+H+1)]
dp[0] = 0

for i in range(n):
    for j in range(h+1):
        if dp[j+a[i]] > dp[j] + b[i]:
            dp[j+a[i]] = dp[j] + b[i]

print(min(dp[h:]))
Buggy python submission (verdict: Runtime Error):
from functools import reduce
from fractions import gcd
from collections import defaultdict,Counter
import copy

n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7

dic = defaultdict(int)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

for i in a:
    c = Counter(prime_factorize(i))
    for j,k in c.items():
        if dic[j] < k:
            dic[j] = k

point = 0

for i in a:
    dic2 = copy.deepcopy(dic)
    e = Counter(prime_factorize(i))
    for j,k in e.items():
        dic2[j] -= k
    now = 1
    for j,k in dic2.items():
        for l in range(k):
            now *= j
            now %= mod
    point += now%mod

print(point%mod)

Fixed submission:
from sys import stdin

n,m = [int(x) for x in stdin.readline().rstrip().split()]

if n == m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from itertools import combinations_with_replacement

x = int(stdin.readline().rstrip())

li = [0,1,2,3,4,5]

kosuu = x//100
amari = x%100

lin = list(combinations_with_replacement(li, kosuu))

for i in lin:
    if sum(i) == amari:
        print(1)
        exit()

print(0)

Fixed submission:
from sys import stdin
from itertools import combinations_with_replacement

x = int(stdin.readline().rstrip())

li = [0,1,2,3,4,5]

kosuu = x//100
amari = x%100

if amari > kosuu*5:
    print(0)
else:
    print(1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
li = list(map(int,input().split()))

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    ix = xyz[i].index(li[i])
    if ix > 2:
        print(0)
        exit()
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3

for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)

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

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    if li[i] not in xyz[i]:
        print(0)
        exit()
    ix = xyz[i].index(li[i])
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3

for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)

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

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    ix = xyz[i].index(li[i])
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3
for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)

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

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    if li[i] not in xyz[i]:
        print(0)
        exit()
    ix = xyz[i].index(li[i])
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3

for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)

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

pos = [0]*n
pos[0] = 3

mod = 10**9+7

if li[1]-li[0] == 0:
    pos[1] = 6
else:
    pos[1] = 3

for i in range(2,n):
    #連続3つが違う色
    if li[i]-li[i-2] == 0:
        pos[i] = pos[i-2]*2%mod
    #連続3つが同じ色
    elif li[i]-li[i-2] == 2:
        pos[i] = pos[i-2]
    #二つが同じ色
    else:
        pos[i] = pos[i-2]*4%mod

print(pos[-1])

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

xyz = [[0,0,0]for _ in range(n)]
xyz[0] = [0,0,0]

mod = 10**9+7

for i in range(n-1):
    if li[i] not in xyz[i]:
        print(0)
        exit()
    ix = xyz[i].index(li[i])
    for j in range(3):
        if j == ix:
            xyz[i+1][j] = xyz[i][j] + 1
        else:
            xyz[i+1][j] = xyz[i][j]

point = 3

for i in range(1,n):
    point *= xyz[i].count(li[i])
    point %= mod
print(point)
Buggy python submission (verdict: Time Limit Exceeded):
from queue import deque

n = int(input())
l = [list(map(int,input().split())) for _ in range(n-1)]
li = [[0 for i in range(n)]for j in range(n)]

for i,j in l:
    i,j = i-1,j-1
    li[i][j] = 1
    li[j][i] = 1

ans = [[0 for i in range(n)]for j in range(n)]
before_color = {}
before_color[0] = 0
visited_node = [False]*n
visited_node[0] = True

max_color = 1

# 幅優先探索（BFS）
def breadth_first_search(start, W):
    global max_color
    # リストをキューにする
    work_queue = deque([])
    visited = set()
    # 初期化
    work_queue.append(start)
    visited.add(start)

    while work_queue:
        # 今いる頂点
        here = work_queue.popleft()
        # 今いる頂点に隣接する頂点すべてを処理する
        for i, node in enumerate(W[here]):
            # 隣接しなければ何もしない
            if node == 0: continue
            if i not in visited:
                work_queue.append(i)
                visited.add(i)
        color = 1
        for j in work_queue:
            if visited_node[j]:
                continue
            else:
                visited_node[j] = True
            if color == before_color[here]:
                color += 1
            before_color[j] = color
            ans[here][j] = color
            ans[j][here] = color
            max_color = max(max_color,color)
            color += 1
    return visited

breadth_first_search(0,li)
print(max_color)
for i,j in l:
    i,j = i-1,j-1
    print(ans[i][j])

Fixed submission:
from queue import deque

n = int(input())
l = [list(map(int,input().split())) for _ in range(n-1)]
li = [[] for _ in range(n)]

for i,j in l:
    i,j = i-1,j-1
    li[i].append(j)
    li[j].append(i)

stack = 0
color = [0]*n

work_queue = deque([])
visited = [False]*n
visited[0] = True
color_list = [0]*n
work_queue.append(stack)
path = {}
ma = 0
while work_queue:
    here = work_queue.popleft()
    color = 1
    for i in li[here]:
        if visited[i]:
            continue
        work_queue.append(i)
        visited[i] = True
        if color_list[here] == color:
            color += 1
        path[(here,i)] = color
        color_list[i] = color
        ma = max(ma,color)
        color += 1

print(ma)
for i,j in l:
    i,j = i-1,j-1
    print(path[(i,j)])
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import math
import bisect
import heapq
import numpy as np
from math import factorial

x,y = [int(x) for x in stdin.readline().rstrip().split()]

if (x+y)%3 != 0:
    print(0)
    exit()

a = (2*x-y)//3
b = (2*y-x)//3

def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

print(combinations_count(a+b,a)%(10**9+7))

Fixed submission:
from sys import stdin
import math
import bisect
import heapq
import numpy as np
from math import factorial
mod = 1000000007
x,y = [int(x) for x in stdin.readline().rstrip().split()]

if (x+y)%3 != 0:
    print(0)
    exit()

a = (2*x-y)//3
b = (2*y-x)//3

if a < 0 or b < 0:
    print(0)
    exit()

def combination(n,r,mod=10**9+7):
    r=min(r,n-r)
    up,down=1,1
    for i in range(r):
        up=up*(n-i)%mod
        down=down*(i+1)%mod
    return up*pow(down,mod-2,mod)%mod

print(combination(a+b,a))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import bisect
from itertools import groupby
 
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
 
li.sort()
lin = []

for key, value in groupby(li):
    lin.append((key,len(list(value))))

lin.sort()

if lin[0][0] != 0 or lin[0][1] > 1:
    print(0)
    exit()

point = 1
for i in range(1,len(lin)):
    if lin[i-1][0]+1 != lin[i][0]:
        print(0)
        exit()
    
    point *= (lin[i-1][1]**lin[i][1])

print(point%998244353)

Fixed submission:
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())

if n %2 == 1:
    print(n//2)
else:
    print(n//2-1)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
import bisect
from itertools import groupby
 
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
 
li.sort()
lin = []

for key, value in groupby(li):
    lin.append((key,len(list(value))))

if lin[0][0] != 0 or lin[0][1] > 1:
    print(0)
    exit()

point = 1
for i in range(1,len(lin)):
    if lin[i-1][0] +1 != lin[i][0]:
        print(0)
        exit()
    point *= lin[i-1][1]**lin[i][1]

print(point%998244353)

Fixed submission:
from sys import stdin
import fractions

n = int(stdin.readline().rstrip())

if n %2 == 1:
    print(n//2)
else:
    print(n//2-1)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
li.sort()

from itertools import combinations

lin = list(combinations(li, 3))

point = 0
ima = lin[0][0]
for i in range(len(lin)):
    if lin[i][0] == ima:
        if lin[i][2] < lin[i][0] + lin[i][1]:
            point += 1
        else:
            continue
    else:
        ima = lin[i][0]
        if lin[i][2] < lin[i][1] + lin[i][0]:
            point += 1

print(point)

Fixed submission:
from sys import stdin
import bisect

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

li.sort()

point = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        bi = bisect.bisect_left(li,li[i]+li[j])
        point += bi-j-1
print(point)

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

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

from itertools import combinations
lin = list(combinations(li, 3))
point = 0
for i in range(len(lin)):
    lin[i] = list(lin[i])
    lin[i].sort()
    if lin[i][2] < lin[i][0] + lin[i][1]:
        point += 1
print(point)

Fixed submission:
from sys import stdin
import bisect

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

li.sort()

point = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        bi = bisect.bisect_left(li,li[i]+li[j])
        point += bi-j-1
print(point)

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

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

from itertools import combinations
lin = list(combinations(li, 3))

point = 0
for i in range(len(lin)):
    if lin[i][0] < (lin[i][1] + lin[i][2]) and lin[i][1] < (lin[i][2] + lin[i][0]) and lin[i][2] < (lin[i][1] + lin[i][0]):
        point += 1
print(point)

Fixed submission:
from sys import stdin
import bisect

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))

li.sort()

point = 0

for i in range(n-2):
    for j in range(i+1,n-1):
        bi = bisect.bisect_left(li,li[i]+li[j])
        point += bi-j-1
print(point)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import groupby

s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

def cou(st):
    li = []
    point = 1
    for i in range(len(st)-1):
        if st[i] == st[i+1]:
            point += 1
            if i == len(st)-2:
                li.append(point)
        else:
            li.append(point)
            point = 1
    return li

lin = cou(s)

if len(lin) == 1:
    print(lin[0]*k//2)
    exit()

if k > 1:
    if s[0] == s[-1]:
        lin[-1] += lin[0]
else:
    if len(s) == 1:
        print(0)
        exit()

point = 0
for i in range(1,len(lin)):
    point += lin[i]//2
point = point*k+lin[0]//2
print(point)

Fixed submission:
# AGC039A - Connection and Disconnection
from itertools import groupby


def main():
    S = input().rstrip()
    K = int(input())
    cnt = [len(tuple(s)) for _, s in groupby(S)]  # count of continuous characters
    if S[0] == S[-1] and K > 1:
        if len(cnt) == 1:  # one character
            ans = cnt[0] * K // 2
        else:  # first (= last) character in S + characters inside S
            ans = cnt[0] // 2 + cnt[-1] // 2 + (cnt[0] + cnt[-1]) // 2 * (K - 1)
            ans += sum(i // 2 for i in cnt[1:-1]) * K
    else:
        ans = sum(i // 2 for i in cnt) * K
    print(ans)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import groupby

s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

san = s*2

def cou(st):
    li = []
    point = 1
    for i in range(len(st)-1):
        if st[i] == st[i+1]:
            point += 1
            if i == len(st)-2:
                li.append(point)
        else:
            li.append(point)
            point = 1
    return li

lin = cou(s)

if len(lin) == 1:
    print(lin[0]*k//2)
    exit()

if k >= 1:
    if s[0] == s[-1]:
        lin[-1] += lin[0] 

point = 0
for i in range(1,len(lin)):
    point += lin[i]//2
point = point*k+lin[0]//2
print(point)

Fixed submission:
# AGC039A - Connection and Disconnection
from itertools import groupby


def main():
    S = input().rstrip()
    K = int(input())
    cnt = [len(tuple(s)) for _, s in groupby(S)]  # count of continuous characters
    if S[0] == S[-1] and K > 1:
        if len(cnt) == 1:  # one character
            ans = cnt[0] * K // 2
        else:  # first (= last) character in S + characters inside S
            ans = cnt[0] // 2 + cnt[-1] // 2 + (cnt[0] + cnt[-1]) // 2 * (K - 1)
            ans += sum(i // 2 for i in cnt[1:-1]) * K
    else:
        ans = sum(i // 2 for i in cnt) * K
    print(ans)


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

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
li2 = []
for i in range(1,len(li)+1):
    s = li.index(i)
    li2.append(s+1)

print(' '.join(map(str, li2)))

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
li2 = [0 for _ in range(n)]
for i in range(len(li)):
    li2[li[i]-1] = i+1
print(' '.join(map(str, li2)))
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n,k,q = [int(x) for x in stdin.readline().rstrip().split()]
li = [stdin.readline().rstrip() for i in range(q)]
li = [int(v) for v in li]
lin = [k for _ in range(n)]
for i in range(q):
    lin[li[i]-1] += 1
    for s in range(n):
        lin[s] -= 1
for j in range(n):
    if lin[j] <= 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
from sys import stdin

n,k,q = [int(x) for x in stdin.readline().rstrip().split()]
li = []
for _ in range(q):
    li.append(stdin.readline().rstrip())
li = list(map(int, li))
p = k-q
lin = [p for _ in range(n)]
for i in range(q):
    lin[li[i]-1] += 1
for v in range(n):
    if lin[v] > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()

def z_algo(S):
    N = len(S)
    A = [0]*N
    i = 1; j = 0
    A[0] = l = len(S)
    while i < l:
        while i+j < l and S[j] == S[i+j]:
            j += 1
        if not j:
            i += 1
            continue
        A[i] = j
        k = 1
        while l-i > k < j - A[k]:
            A[i+k] = A[k]
            k += 1
        i += k; j -= k
    return A

ma = 0

for i in range(1,n-1):
    li = z_algo(s[i:])
    max_li = max(li[1:])
    ma = max(ma,max_li)

print(ma)

Fixed submission:
n = int(input())
s = input()

max_len = 0
j = 0

for i in range(n):
    while j < n and s[i:j] in s[j:]:
        j += 1
    max_len = max(max_len,j-i-1)

print(max_len)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from math import factorial

n = int(stdin.readline().rstrip().split())

print(n**3)

Fixed submission:
from sys import stdin
from math import factorial
n = int(stdin.readline().rstrip())
print(n**3)
Buggy python submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
data = list(map(int,stdin.readline().rstrip().split()))
li = []
point = 0
k = 0
while k < n-1:
    for i in range(k,n-1):
        if data[i] >= data[i+1]:
            k += 1
            point += 1
        else:
            li.append(point)
            k += 1
            break
    
    li.append(point)
    point = 0
print(max(li))

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
data = list(map(int,stdin.readline().rstrip().split()))
zantei = 0
k = 0
while k < n-1:
    point = 0
    for i in range(k,n-1):
        if data[i] >= data[i+1]:
            k += 1
            point += 1
        else:
            k += 1
            break
    if point > zantei:
        zantei = point
    point = 0
print(zantei)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
data = list(map(int,stdin.readline().rstrip().split()))
li = []
point = 0
k = 0
while k < n-1:
    for i in range(k,n-1):
        if data[i] >= data[i+1]:
            k += 1
            point += 1
        else:
            li.append(point)
            k += 1
            break
    
    li.append(point)
    point = 0
print(max(li))

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
data = list(map(int,stdin.readline().rstrip().split()))
zantei = 0
k = 0
while k < n-1:
    point = 0
    for i in range(k,n-1):
        if data[i] >= data[i+1]:
            k += 1
            point += 1
        else:
            k += 1
            break
    if point > zantei:
        zantei = point
    point = 0
print(zantei)
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin

n = int(stdin.readline().rstrip())
point = 0
for i in range(1,n+1):
    point += i%n
print(point)

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
n = int(stdin.readline().rstrip())
if n == 1:
    print(0)
else:
    point = 0
    for i in range(1,n):
        point += i
    print(point)

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from itertools import accumulate
n = int(stdin.readline().rstrip())
li = [p for p in range(1,n)]
if n == 1:
    print(0)
else:
    lin = list(accumulate(li))
    print(lin[-1])

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
from itertools import accumulate
n = int(stdin.readline().rstrip())
li = [p for p in range(1,n)]
if n == 1:
    print(0)
else:
    lin = list(accumulate(li))
    print(max(lin))

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
n = int(stdin.readline().rstrip())
li = [p for p in range(1,n)]
if n == 1:
    print(0)
else:
    print(sum(li))

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate
n = int(stdin.readline().rstrip())
if n == 1:
    print(0)
else:
    a = list(range(1, n))
    b = list(accumulate(a))
    print(max(b))

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate
n = int(stdin.readline().rstrip())
if n == 1:
    print(0)
else:
    a = list(range(1, n))
    b = list(accumulate(a))
    print(b[-1])

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)

Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import accumulate#累積和

n = int(stdin.readline().rstrip())
if n == 1:
    print(0)
else:
    a = list(range(1, n))
    b = list(accumulate(a))
    print(b[-1])  

Fixed submission:
from sys import stdin

n = int(stdin.readline().rstrip())
point = n*(n-1)//2
print(point)