Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math



N = int(input())
tn,an = [1,1]
for _ in range(N):
  t,a = map(int, input().split())
  idx = 1
  while t*idx < tn or a*idx < an:
    idx += 1
  tn,an = [t*idx,a*idx]
print(tn+an)

Fixed submission:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import math
import decimal


N = int(input())
tn,an = [1,1]
for _ in range(N):
  t,a = map(int, input().split())
  x = max(math.ceil(decimal.Decimal(tn)/decimal.Decimal(t)),math.ceil(decimal.Decimal(an)/decimal.Decimal(a)))
  tn,an = [t*x,a*x]
print(tn+an)
Buggy python submission (verdict: Runtime Error):
import sys, math

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

A, B, X = MAP()
V = A* A * B - X
if V < X:
    # Y = 2 * vacant / A / A
    ans = 90 - math.degrees(math.atan(A**3 / (2*V)))
else:
    # Y = 2 * X / A / B
    ans = 90 - math.degrees(math.atan(2 * X / (A*B*B)))
print(ans)


Fixed submission:
import sys, math

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

A, B, X = MAP()
V = A* A * B - X

if V < X:
    # Y = 2 * vacant / A / A
    if V > 0:
        ans = 90 - math.degrees(math.atan(A**3 / (2*V)))
    else:
        ans = 0
else:
    # Y = 2 * X / A / B
    ans = 90 - math.degrees(math.atan(2 * X / (A*B*B)))
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

S = input()
K = INT()

N = len(S)
numlist = []
count = 1
for i in range(1, N):
    if S[i] == S[i - 1]:
        count += 1
    else:
        numlist.append(count)
        count = 1
numlist.append(count)
flag = 0
if S[0] == S[-1] and len(numlist) > 2:
    center = numlist[0] + numlist[-1]
    ans = (center // 2) * (K - 1)
    ans += numlist[0] // 2
    ans += numlist[-1] // 2
    for i in range(1, len(numlist)-1):
        ans += (numlist[i] // 2) * K
    import pdb; pdb.set_trace()
else:
    ans = 0
    for i in range(len(numlist)):
        ans += (numlist[i] // 2) * K
print(ans)


Fixed submission:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

S = input()
K = INT()

N = len(S)
numlist = []
count = 1
if N == 1:
    print(K // 2)
else:
    for i in range(1, N):
        if S[i] == S[i - 1]:
            count += 1
        else:
            numlist.append(count)
            count = 1
    numlist.append(count)
    if len(numlist) == 1:
        ans = (N * K) // 2
    elif S[0] == S[-1]:
        center = numlist[0] + numlist[-1]
        ans = (center // 2) * (K - 1)
        ans += numlist[0] // 2
        ans += numlist[-1] // 2
        for i in range(1, len(numlist)-1):
            ans += (numlist[i] // 2) * K
    else:
        ans = 0
        for i in range(len(numlist)):
            ans += (numlist[i] // 2) * K
    print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N = INT()
    print(sum(list(range(1, N))))

if __name__ == '__main__':
    main()


Fixed submission:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N = INT()
    count = 0
    for nn in range(1, N):
        count += nn
    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys, math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N, K = MAP()
    NK = N - K + 1
    for i in range(K):
        print(combinations_count(NK, i + 1) * combinations_count(K - 1, i) % mod)

if __name__ == '__main__':
    main()


Fixed submission:
import sys, math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    N, K = MAP()
    NK = N - K + 1
    for i in range(K):
        if NK < i + 1:
            print(0)
        else:
            print(combinations_count(NK, i + 1) * combinations_count(K - 1, i) % mod)

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

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

def main():
    n = int(input())
    x = [list(map(int, input().split())) for _ in range(n)]

    dist = [(x[j][0] - x[i][0], x[j][1] - x[i][1]) for j in range(n) for i in range(n)]
    c = collections.Counter(dist)
    ans = c.most_common()
    print(n - ans[1][1])

if __name__ == '__main__':
    main()


Fixed submission:
import sys
import collections

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

def main():
    n = int(input())
    x = [list(map(int, input().split())) for _ in range(n)]

    if n == 1:
        print(1)
    else:
        dist = [(x[j][0] - x[i][0], x[j][1] - x[i][1]) for j in range(n) for i in range(n)]
        c = collections.Counter(dist)
        ans = c.most_common()
        print(n - ans[1][1])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    h, w = map(int, input().split())
    ss = [input() for _ in range(h)]

    matl = [[0 for _ in range(w)] for _ in range(h)]
    matr = [[0 for _ in range(w)] for _ in range(h)]
    matu = [[0 for _ in range(w)] for _ in range(h)]
    matd = [[0 for _ in range(w)] for _ in range(h)]

    for j in range(h):
        for i in range(w):
            if ss[j][i] == '#':
                matd[j][i] = 0
            elif j == 0:
                matd[j][i] = 1
            else:
                matd[j][i] = matd[j - 1][i] + 1

            if ss[h - j - 1][i] == '#':
                matu[h - j - 1][i] = 0
            elif h - j == h:
                matu[h - j - 1][i] = 1
            else:
                matu[h - j - 1][i] = matu[h - j][i] + 1

            if ss[j][i] == '#':
                matr[j][i] = 0
            elif i == 0:
                matr[j][i] = 1
            else:
                matr[j][i] = matr[j][i - 1] + 1

            if ss[j][w - i - 1] == '#':
                matl[j][w - i - 1] = 0
            elif w - i == w:
                matl[j][w - i - 1] = 1
            else:
                matl[j][w - i - 1] = matl[j][w - i] + 1

    maxv = 0
    for j in range(h):
        for i in range(w):
            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]
            if tmp > maxv:
                maxv = tmp
    print(maxv - 3)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    p, q, r = map(int, input().split())
    minv = p + q
    if minv > p + r:
        minv = p + r
    if minv > q + r:
        minv = q + r
    print(minv)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    h, w = map(int, input().split())
    ss = [input() for _ in range(h)]

    matl = [[0 for _ in range(w)] for _ in range(h)]
    matr = [[0 for _ in range(w)] for _ in range(h)]
    matu = [[0 for _ in range(w)] for _ in range(h)]
    matd = [[0 for _ in range(w)] for _ in range(h)]

    for j in range(h):
        for i in range(w):
            if ss[j][i] == '#':
                matd[j][i] = 0
            elif j == 0:
                matd[j][i] = 1
            else:
                matd[j][i] = matd[j - 1][i] + 1

            if ss[h - j - 1][i] == '#':
                matu[h - j - 1][i] = 0
            elif h - j == h:
                matu[h - j - 1][i] = 1
            else:
                matu[h - j - 1][i] = matu[h - j][i] + 1

            if ss[j][i] == '#':
                matr[j][i] = 0
            elif i == 0:
                matr[j][i] = 1
            else:
                matr[j][i] = matr[j][i - 1] + 1

            if ss[j][w - i - 1] == '#':
                matl[j][w - i - 1] = 0
            elif w - i == w:
                matl[j][w - i - 1] = 1
            else:
                matl[j][w - i - 1] = matl[j][w - i] + 1

    maxv = 0
    for j in range(h):
        for i in range(w):
            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]
            if tmp > maxv:
                maxv = tmp
    print(maxv - 3)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    h, w = map(int, input().split())
    ss = [input() for _ in range(h)]

    matl = [[0 for _ in range(w)] for _ in range(h)]
    matr = [[0 for _ in range(w)] for _ in range(h)]
    matu = [[0 for _ in range(w)] for _ in range(h)]
    matd = [[0 for _ in range(w)] for _ in range(h)]

    for j in range(h):
        for i in range(w):
            if ss[j][i] == '#':
                matd[j][i] = 0
            elif j == 0:
                matd[j][i] = 1
            else:
                matd[j][i] = matd[j - 1][i] + 1

            if ss[h - j - 1][i] == '#':
                matu[h - j - 1][i] = 0
            elif h - j == h:
                matu[h - j - 1][i] = 1
            else:
                matu[h - j - 1][i] = matu[h - j][i] + 1

            if ss[j][i] == '#':
                matr[j][i] = 0
            elif i == 0:
                matr[j][i] = 1
            else:
                matr[j][i] = matr[j][i - 1] + 1

            if ss[j][w - i - 1] == '#':
                matl[j][w - i - 1] = 0
            elif w - i == w:
                matl[j][w - i - 1] = 1
            else:
                matl[j][w - i - 1] = matl[j][w - i] + 1

    maxv = 0
    for j in range(h):
        for i in range(w):
            tmp = matu[j][i] + matd[j][i] + matr[j][i] + matl[j][i]
            if tmp > maxv:
                maxv = tmp
    print(maxv - 3)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    s = input().replace('BC', 'X')
    count = 0
    N = len(s)
    for i in range(N - 1):
        if s[i] == 'A':
            n = 1
            while i + n < N:
                if s[i + n] == 'A':
                    n += 1
                    continue
                elif s[i + n] == 'X':
                    n += 1
                    count += 1
                else:
                    break
    print(count)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    s = input().replace('BC', 'X')[::-1]
    N = len(s)
    count = 0
    tmp = 0
    for i in range(N):
        if s[i] == 'X':
            tmp += 1
        elif s[i] == 'A':
            count += tmp
        else:
            tmp = 0
    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    for i in range(m):
        b, c = map(int, input().split())
        a += [c for _ in range(b)]

    a = sorted(a, reverse=True)
    print(sum(a[:n]))

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    x = [[aa, 1] for aa in a]
    for i in range(m):
        b, c = map(int, input().split())
        x += [[c, b]]

    x = sorted(x, reverse=True)
    count = 0
    sum = 0
    for i in range(n):
        count += x[i][1]
        if count <= n:
            sum += x[i][0] * x[i][1]
        else:
            sum += x[i][0] * (x[i][1] - (count - n))
            break
    print(sum)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    r, g, b, n = map(int, (input().split()))

    count = 0
    for rr in range(n//r + 1):
        for gg in range((n-rr*r)//g + 1):
            for bb in range((n-rr*r-gg*g)//b + 1):
                if (rr*r + gg*g + bb*b) == n:
                    count += 1
    print(count)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    r, g, b, n = map(int, (input().split()))

    count = 0
    for rr in range(n//r + 1):
        for gg in range((n-rr*r)//g + 1):
            if (n-rr*r-gg*g) % b == 0:
                count += 1
    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    s = [input() for i in range(n)]

    AB = 0
    B_ = 0
    _A = 0
    B_A = 0
    for ss in s:
        for i in range(len(ss)-1):
            if ss[i:i+2] == 'AB':
                AB += 1
        if ss[0] == 'B':
            if ss[-1] == 'A':
                B_A += 1
            else:
                B_ += 1
        elif ss[-1] == 'A':
            _A += 1
    if _A == B_ && _A > 1:
        print(AB + max((B_A - 1), 0) + max(min(B_ + int(B_A > 0), _A), min(B_, _A + int(B_A > 0))) + 1)
    else:
        print(AB + max((B_A - 1), 0) + max(min(B_ + int(B_A > 0), _A), min(B_, _A + int(B_A > 0))))
    # print(AB, B_, _A, B_A)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n = int(input())
    s = [input() for i in range(n)]

    AB = 0
    B_ = 0
    _A = 0
    B_A = 0
    for ss in s:
        for i in range(len(ss)-1):
            if ss[i:i+2] == 'AB':
                AB += 1
        if ss[0] == 'B':
            if ss[-1] == 'A':
                B_A += 1
            else:
                B_ += 1
        elif ss[-1] == 'A':
            _A += 1
    if B_A > 0:
        if _A > 0 and B_ > 0:
            print(AB + (B_A - 1) + 2 + min(_A - 1, B_ - 1))
        elif _A == 0 and B_ == 0:
            print(AB + (B_A - 1))
        else:
            print(AB + (B_A - 1) + 1)
    else:
        print(AB + min(_A, B_))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    v = [int(v) for v in input().split()]
    c = [int(c) for c in input().split()]

    max_total = 0
    for i in range(2 ** n):
        total = 0
        for j in range(n):  # このループが一番のポイント
            if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
                total += v[j]
                total -= c[j]
        if total > max_total:
            max_total = total
    print(max_total)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n = int(input())
    v = [int(v) for v in input().split()]
    c = [int(c) for c in input().split()]

    total = 0
    for nn in range(n):
        if v[nn] > c[nn]:
            total += v[nn]
            total -= c[nn]
    print(total)

    # max_total = 0
    # for i in range(2 ** n):
    #     total = 0
    #     for j in range(n):  # このループが一番のポイント
    #         if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
    #             total += v[j]
    #             total -= c[j]
    #     if total > max_total:
    #         max_total = total
    # print(max_total)

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

def main(argv):
    A = int(argv[0])
    B = int(argv[1])
    C = int(argv[2])
    print(judge(A, B, C))

def judge(A, B, C):
    if (A < C and A < B) or (C < A and B < A):
        return 'Yes'
    else:
        return 'No'

if __name__ == '__main__':
    main(sys.argv[1:])


Fixed submission:
import sys

def main():
    argv = input().split()
    A = int(argv[0])
    B = int(argv[1])
    C = int(argv[2])
    print(judge(A, B, C))

def judge(A, B, C):
    if (A < C and C < B) or (C < A and B < C):
        return 'Yes'
    else:
        return 'No'

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

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    X, Y, Z, K = MAP()
    A = sorted(LIST(), reverse=True)
    B = sorted(LIST(), reverse=True)
    C = sorted(LIST(), reverse=True)
    tmp = []
    for aa in range(X):
        for bb in range(Y):
            for cc in range(Z):
                if (aa + 1) * (bb + 1) * (cc + 1) <= K:
                    tmp.append(A[aa] + B[bb] + C[cc])
    tmp.sort(reverse=True)
    for kk in range(K):
        print(tmp[kk])

if __name__ == '__main__':
    main()


Fixed submission:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    X, Y, Z, K = MAP()
    A = sorted(LIST(), reverse=True)
    B = sorted(LIST(), reverse=True)
    C = sorted(LIST(), reverse=True)
    tmp = []
    for aa in range(X):
        for bb in range(Y):
            for cc in range(Z):
                if (aa + 1) * (bb + 1) * (cc + 1) <= K:
                    tmp.append(A[aa] + B[bb] + C[cc])
                else:
                    break
    tmp.sort(reverse=True)
    for kk in range(K):
        print(tmp[kk])

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

n=int(input())
ls=list(map(int,input().split()))
ms=[]

#最初の山の値を求める
for i in range(0,10**9,2):
    x=i
    for j in range(n):
        x=(ls[j]-x//2)*2
    if x==0:
        ms.append(i//2)
        break

for i in range(n-1):
    ms.append((ls[i]-ms[-1]//2)*2)
print(*ms)


Fixed submission:
_,a=open(0)
*a,=map(int,a.split())
t=sum(a)-2*sum(a[1::2])
x=[t]
for i in a:
  t=i*2-t
  x+=t,
print(*x[:-1])
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
def lcm(x,y):
    return (x*y)//math.gcd(x,y)
lm=lcm(c,d)
print(lm)

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return(a)

a,b,c,d=map(int,input().split())
cn1=0
cn2=0
cn3=0
an1=0
an2=0
an3=0
cnt=0
ans=0
lm=(c*d)//gcd(c,d)

#bまで
cn1=b//c
cn2=b//d
cn3=b//lm
#aまで
an1=(a-1)//c
an2=(a-1)//d
an3=(a-1)//lm
#aからbまで
cn1=cn1-an1
cn2=cn2-an2
cn3=cn3-an3

cnt=cn1+cn2-cn3
ans=b-a-cnt+1

print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
from bisect import bisect_left
rint(n - bisect_left(sorted(h),k))

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
from bisect import bisect_left
print(n - bisect_left(sorted(h),k))
Buggy python submission (verdict: Runtime Error):
a = int (input())
s = int (input())
print(s) if a>>3200 else print("red")

Fixed submission:
a = int (input())
s = input()
print(s) if a >= 3200 else print("red")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input()))
ans = 0
for _a in a:
    ans +=1/_a
print(1/ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for _a in a:
    ans +=1/_a
print(1/ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
anagram =[]
ans = 0
for _ in range(n):
    s = ''.join(input())
    anagram.append(s)
count_ana = Counter(anagram)
for v in count_ana.values():
    ans += v * (v + 1) // 2
print(ans)

Fixed submission:
from collections import Counter 
n = int(input())
anagram =[]
ans = 0
for _ in range(n):
    s = ''.join(sorted(input()))
    anagram.append(s)
count_ana = Counter(anagram)
for v in count_ana.values():
    ans += v * (v - 1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))[::-1]
if n ==1:
    print('Yes')
else:
    for i in range(1,n):
        if h[i] > (h[i - 1] + 1):
            print('No')
            break
        elif h[i] == (h[i - 1] + 1):
            h[i] = h[i - 1]
        print(h)
    else:
        print('Yes')

Fixed submission:
n = int(input())
h = list(map(int, input().split()))[::-1]
if n ==1:
    print('Yes')
else:
    for i in range(1,n):
        if h[i] > (h[i - 1] + 1):
            print('No')
            break
        elif h[i] == (h[i - 1] + 1):
            h[i] = h[i - 1]
    else:
        print('Yes')
Buggy python submission (verdict: Runtime Error):
n = input()
w = list(map(int, input().split()))
w = np.array(w)
print(np.min(np.abs(2 * np.cumsum(w) -np.sum(w))))

Fixed submission:
import numpy as np
n = input()
w = list(map(int, input().split()))
w = np.array(w)
print(np.min(np.abs(2 * np.cumsum(w) -np.sum(w))))