Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys

def input(): return sys.stdin.readline().rstrip("\r\n")
def List(): return list(map(int, input().split()))
def Num(): return int(input())


x, k, d = List()
x = abs(x)
if k * d > x:
    point1 = x - (x // d) * d
    point2 = point1 - d
    travel_to_point1 = (x - point1) // d
    travel_to_point2 = (x - point2) // d
    pair = [[abs(point1), abs(travel_to_point1)], [abs(point2), abs(travel_to_point2)]]
    pair.sort(key = lambda i: i[0])
    # print(pair)
    if pair[0][1] != 0 or pair[1][1] != 0:
        if k % pair[0][1] == 0:
            if pair[0][1] != 1:
                print(pair[0][0])
            else:
                if k & 1:
                    print(pair[0][0])
                else:
                    print(pair[1][0])
        else:
            if pair[1][1] != 1:
                print(pair[1][0])
            else:
                if k & 1:
                    print(pair[1][0])
                else:
                    print(pair[0][0])
    else:
        if pair[0][1] == 0:
            if k % 2 == 0:
                print(pair[0][0])
            else:
                print(pair[1][0])
        else:
            if k % 2 == 0:
                print(pair[1][0])
            else:
                print(pair[0][0])

else:
    print(x - k * d)


Fixed submission:
import sys

def input(): return sys.stdin.readline().rstrip("\r\n")
def List(): return list(map(int, input().split()))
def Num(): return int(input())


x, k, d = List()
x = abs(x)
if d * k > x:
    distance = x % d
    do = k - (x // d)
    if do & 1:
        print(d - distance)
    else:
        print(distance)
else:
    print(x - k * d)

Buggy python submission (verdict: Runtime Error):
import sys

def input(): return sys.stdin.readline().rstrip("\r\n")
def List(): return list(map(int, input().split()))
def Num(): return int(input())


x, k, d = List()
x = abs(x)
if k * d > x:
    point1 = x - (x // d) * d
    point2 = point1 - d
    travel_to_point1 = (x - point1) // d
    travel_to_point2 = (x - point2) // d
    pair = [[abs(point1), abs(travel_to_point1)], [abs(point2), abs(travel_to_point2)]]
    pair.sort(key = lambda i: i[0])
    # print(pair)
    if k % pair[0][1] == 0:
        if pair[0][1] != 1:
            print(pair[0][0])
        else:
            if k & 1:
                print(pair[0][0])
            else:
                print(pair[1][0])
    else:
        if pair[1][1] != 1:
            print(pair[1][0])
        else:
            if k & 1:
                print(pair[1][0])
            else:
                print(pair[0][0])

else:
    print(x - k * d)


Fixed submission:
import sys

def input(): return sys.stdin.readline().rstrip("\r\n")
def List(): return list(map(int, input().split()))
def Num(): return int(input())


x, k, d = List()
x = abs(x)
if d * k > x:
    distance = x % d
    do = k - (x // d)
    if do & 1:
        print(d - distance)
    else:
        print(distance)
else:
    print(x - k * d)
Buggy python submission (verdict: Runtime Error):
"""
~~ Author : Bhaskar
~~ Dated : 10~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")
input = lambda : sys.stdin.readline()

def solve():
    n = int(sys.stdin.readline())
    print(a+a**2+a**3)


if __name__ == "__main__":
    try:
        sys.stdin = open('input.txt','r')
        sys.stdout = open('output.txt','w')
    except:
       pass
    solve()



Fixed submission:
"""
~~ Author : Bhaskar
~~ Dated : 10~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")
input = lambda : sys.stdin.readline()

def solve():
    n = int(sys.stdin.readline())
    print(n + n ** 2 + n ** 3)
    


if __name__ == "__main__":
    try:
        sys.stdin = open('input.txt','r')
        sys.stdout = open('output.txt','w')
    except:
       pass
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
#author : dokueki

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n = int(sys.stdin.readline())
    s = input()
    ans = 0
    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if s[i] != s[j] and s[i] != s[k] and s[j] != s[k] and j - i != k - j:
                    ans += 1
    print(ans)


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()


Fixed submission:
#author : dokueki

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n = int(sys.stdin.readline())
    s = input()
    R, G, B = set(), set(), set()
    # tot = len(r) * len(g) * len(b)
    for i in range(n):
        if s[i] == "R":
            R.add(i + 1)
        if s[i] == "G":
            G.add(i + 1)
        if s[i] == "B":
            B.add(i + 1)
    tot = len(R)*len(G)*len(B)
    for r in R:
        for g in G:
            l = g - r
            if g + l in B:
                tot -= 1
            if r - l in B:
                tot -= 1
            if l % 2 == 0 and l // 2 + r in B:
                tot -= 1
    print(tot)

    # print(tot)


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()
Buggy python submission (verdict: Runtime Error):
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    s = input()
    if s[2] == s[3] and s[4] == s[5]:
        print("Yes")
    else:
        print(No)



if __name__ == "__main__":
    #IOE()
    main()


Fixed submission:
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    s = input()
    if s[2] == s[3] and s[4] == s[5]:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    #IOE()
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def rev(x, limit):
    s = 0
    for i in range(len(x) - 1):
        if x[i] == 0:
            x[i] = limit
        s += abs(x[i] - x[i + 1])
        # print(s)
    return s


def main():
    k, n = map(int, sys.stdin.readline().split())
    a = list(map(int, sys.stdin.readline().split()))
    daf = a[-1] - a[0]
    minn = min(daf, int(10e10))
    for i in range(1, n):
        grab = [a[i]] + a[:i] + a[i + 1:]
        #print(grab)
        minn = min(rev(grab, k), minn)
    print(minn)


if __name__ == "__main__":
    #IOE()
    main()


Fixed submission:
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    k, n = map(int, sys.stdin.readline().split())
    a = list(map(int, sys.stdin.readline().split()))
    minn = min(a[n - 1] - a[0], int(10e10))
    for i in range(n):
        ans = (a[n - 1] - a[i]) + (k + a[i - 1] - a[n - 1])
        minn = min(ans, minn)
    print(minn)


if __name__ == "__main__":
    # IOE()
    main()
Buggy python submission (verdict: Runtime Error):
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    x, y, a, b, c = map(int, sys.stdin.readline().split())
    r = list(map(int, sys.stdin.readline().split()))
    g = list(map(int, sys.stdin.readline().split()))
    blind = list(map(int, sys.stdin.readline().split()))
    r.sort(reverse=True)
    g.sort(reverse=True)
    blind.sort(reverse=True)
    red_need = r[:x]
    green_need = g[:y]
    res = red_need + green_need
    res.sort()
    #print(res)
    for i in range(c):
        if blind[i] > res[i]:
            res[i] = blind[i]
    print(sum(res))


if __name__ == "__main__":
    # IOE()
    main()


Fixed submission:
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    x, y, a, b, c = map(int, sys.stdin.readline().split())
    r = list(map(int, sys.stdin.readline().split()))
    g = list(map(int, sys.stdin.readline().split()))
    blind = list(map(int, sys.stdin.readline().split()))
    r.sort(reverse=True)
    g.sort(reverse=True)
    blind.sort(reverse=True)
    red_need = r[:x]
    green_need = g[:y]
    res = red_need + green_need
    res.sort()
    #print(res)
    for i in range(min(c,len(res))):
        if blind[i] > res[i]:
            res[i] = blind[i]
    print(sum(res))


if __name__ == "__main__":
    # IOE()
    main()

Buggy python submission (verdict: Runtime Error):
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    x, y, a, b, c = map(int, sys.stdin.readline().split())
    r = list(map(int, sys.stdin.readline().split()))
    g = list(map(int, sys.stdin.readline().split()))
    blind = list(map(int, sys.stdin.readline().split()))
    r.sort()
    g.sort()
    blind.sort(reverse=True)
    red_need = r[-x:a]
    green_need = g[-y:b]
    res = red_need + green_need
    res.sort()
    # print(res)
    for i in range(c):
        if blind[i] > res[i]:
            res[i] = blind[i]
    print(sum(res))


if __name__ == "__main__":
    #IOE()
    main()


Fixed submission:
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    x, y, a, b, c = map(int, sys.stdin.readline().split())
    r = list(map(int, sys.stdin.readline().split()))
    g = list(map(int, sys.stdin.readline().split()))
    blind = list(map(int, sys.stdin.readline().split()))
    r.sort(reverse=True)
    g.sort(reverse=True)
    blind.sort(reverse=True)
    red_need = r[:x]
    green_need = g[:y]
    res = red_need + green_need
    res.sort()
    #print(res)
    for i in range(min(c,len(res))):
        if blind[i] > res[i]:
            res[i] = blind[i]
    print(sum(res))


if __name__ == "__main__":
    # IOE()
    main()
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
k = math.log2(n) + 1
print(2**math.floor(k)-1)

Fixed submission:
import math
n = int(input())
k = math.log(n, 2) + 1
print(2**math.floor(k)-1)
Buggy python submission (verdict: Runtime Error):
"""
author : dokueki
"""
s = input()
t = "abcdefghijklmnopqrstuvwxyza"
for i in range(len(t)):
    if t[i] == a:
        print(t[i+1])
        break
        

Fixed submission:
"""
author : dokueki
"""
s = input()
t = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(t)):
    if t[i] == s:
        print(t[i+1])
        break
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = tuple(map(int, input().split()))
b = tuple(map(int, input().split()))
x, y = 0, 0
perm = list(permutations(list(range(1, n+1))))
# print(perm)
for i in perm:
    if i == a:
        x = perm.index(i)
    if i == b:
        y = perm.index(i)
print(abs(x-y))


Fixed submission:
from itertools import permutations

n = int(input())
a = tuple(map(int, input().split()))
b = tuple(map(int, input().split()))
x, y = 0, 0
perm = list(permutations(list(range(1, n+1))))
# print(perm)
for i in perm:
    if i == a:
        x = perm.index(i)
    if i == b:
        y = perm.index(i)
print(abs(x-y))
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
div = math.gcd(a,b)
pro = a*b
print(pro//div)

Fixed submission:
def lcm(a,b):
  lar = max(a, b) 
  small = min(a, b) 
  i = lar 
  while(1) : 
    if (i % small == 0): 
      return i 
    i += lar 

x,y = map(int,input().split())
print(lcm(x,y))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print((a*b)//math.gcd(a,b))

Fixed submission:
def lcm(a,b):
  lar = max(a, b) 
  small = min(a, b) 
  i = lar 
  while(1) : 
    if (i % small == 0): 
      return i 
    i += lar 

x,y = map(int,input().split())
print(lcm(x,y))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print((a*b)//math.gcd(a,b))

Fixed submission:
def lcm(a,b):
  lar = max(a, b) 
  small = min(a, b) 
  i = lar 
  while(1) : 
    if (i % small == 0): 
      return i 
    i += lar 

x,y = map(int,input().split())
print(lcm(x,y))
Buggy python submission (verdict: Runtime Error):
"""
~~ Author : Bhaskar
~~ Dated : 07~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi,log
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")

def solve():
    a,b,k = map(int,sys.stdin.readline().split())
    print(b*(k//a))

if __name__ == "__main__":
    try:
        sys.stdin = open("input.txt","r")
    except :
        pass
    solve()


Fixed submission:
a,b,k = map(int,input().split())
print(b*(k//a))
Buggy python submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
pref,suf = [0]*(n+2),[0]*(n+2)
pref[1] = a[0]
for i in range(2,n+1):
    pref[i] = gcd(pref[i-1],a[i-1])
suf[n] = a[n-1]
for i in range(n-1,0,-1):
    suf[i] = gcd(suf[i+1],a[i-1])
ans = max(suf[2],pref[n-1])
for i in range(2,n):
    ans = max(ans,gcd(pref[i-1],suf[i+1]))
print(ans)

Fixed submission:
import sys
# from math import gcd
def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
pref,suf = [0]*(n+2),[0]*(n+2)
pref[1] = a[0]
for i in range(2,n+1):
    pref[i] = gcd(pref[i-1],a[i-1])
suf[n] = a[n-1]
for i in range(n-1,0,-1):
    suf[i] = gcd(suf[i+1],a[i-1])
ans = max(suf[2],pref[n-1])
for i in range(2,n):
    ans = max(ans,gcd(pref[i-1],suf[i+1]))
print(ans)
Buggy python submission (verdict: Runtime Error):
import re
s = input()
match = re.findall(r"[ACGT]+",s)
print(max([len(i) for i in match]))


Fixed submission:
import re
s = input()
match = re.findall(r"[ACGT]+",s)
if len(match)==0:
    print(0)
else:
    print(max([len(i) for i in match]))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print(min((b//a),c)

Fixed submission:
a,b,c = map(int,input().split())
print(min(b//a,c))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
l =[]
for i in range(1,max(a,b)):
  if max(a,b)%i==0:
    l.append(i)

print(l[c-1])



Fixed submission:
a,b,c = map(int,input().split())
l,x,y = [],min(a,b),max(a,b)
for i in range(1,x+1):
  if x%i==0 and y%i==0: 
    l.append(i)
l = l[::-1]
#print(l)
print(l[c-1])

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
l =[]
for i in range(1,min(a,b)):
  if min(a,b)%i==0:
    l.append(i)

print(l[c-1])

Fixed submission:
a,b,c = map(int,input().split())
l,x,y = [],min(a,b),max(a,b)
for i in range(1,x+1):
  if x%i==0 and y%i==0: 
    l.append(i)
l = l[::-1]
#print(l)
print(l[c-1])
Buggy python submission (verdict: Runtime Error):
s = input()
print(700+s.count("o)*100)

Fixed submission:
s = input()
print(700+s.count("o")*100)

Buggy python submission (verdict: Runtime Error):
# @Date:   2020-06-06T20:03:11+05:30
# @Filename: A.py
# @Last modified time: 2020-06-06T20:03:11+05:30
"""
~~ Author : Bhaskar
~~ Dated : 06~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")

def solve():
    s = input()
    o = s.count("o")
    print(700+(o*100))

if __name__ == "__main__":
    try:
        sys.stdin = open("input.txt","r")
    except :
        pass
    solve()


Fixed submission:
s = input()
print(700+s.count("o")*100)
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
li = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    li[a].append(b)
    li[b].append(a)

nodes = [_ for _ in range(n)]
group = [1]*n

def dfs(node, group):
    s = li[node]
    group[node]=0
    for v in s:
        if group[v]!=0:
            dfs(v, group)

cnt = 0       
for i in range(n):
    if group[i]!=0:
        dfs(i,group)
        cnt += 1

print(cnt-1)


Fixed submission:
from collections import deque
n,m = map(int, input().split())
G = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a-=1
    b-=1
    G[b].append(a)
    G[a].append(b)

dist = [-1]*n
que = deque()
cnt = 0

for i in range(n):
    if dist[i]!=-1:
        continue
    dist[i]=0
    que.append(i)
    while len(que):
        v = que.pop()
        s = G[v]
        for j in s:
            if dist[j]!=-1:
                continue
            dist[j]=0
            que.append(j)
    cnt += 1

print(cnt-1)

Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
li = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    li[a].append(b)
    li[b].append(a)

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

def dfs(node, group):
    s = li[node]
    group[node]=0
    for v in s:
        if group[v]!=0:
            dfs(v, group)

cnt = 0       
for i in range(n):
    if group[i]!=0:
        dfs(i,group)
        cnt += 1

print(cnt-1)

Fixed submission:
from collections import deque
n,m = map(int, input().split())
G = [[] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a-=1
    b-=1
    G[b].append(a)
    G[a].append(b)

dist = [-1]*n
que = deque()
cnt = 0

for i in range(n):
    if dist[i]!=-1:
        continue
    dist[i]=0
    que.append(i)
    while len(que):
        v = que.pop()
        s = G[v]
        for j in s:
            if dist[j]!=-1:
                continue
            dist[j]=0
            que.append(j)
    cnt += 1

print(cnt-1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
n = int(input())
li = np.zeros(n, dtype=np.int)
def solve(n):
    s = math.sqrt(n)
    i = 2
    f = {}
    n_ = n
    while i <= s:
        while n_ % i == 0:
            f[i] = f.get(i,0)+1
            n_ = n_ // i
        i += 1

    c = 1
    if n_ > 1:
        f[n_] = 1
    for x in f.values():
        c *= (x+1)
    
    return c

ans = 0
while n > 0:
    n -= 1
    if n==0:
        break
    ans += solve(n)
print(ans)

Fixed submission:
import math
import numpy as np
n = int(input())
li = np.zeros(n, dtype=np.int)
ans = 0
i = 1
while i < n:
    ans += (n-1)//i
    i += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n, x, m = map(int, input().split())
a = x
mod = [a]
loop = []
cnt = 0
while cnt < n:
    a = a**2 % m
    if a in mod:
        i = mod.index(a)
        before = mod[:i]
        loop = mod[i:]
        break
    mod.append(a)
    cnt += 1

length = len(loop)
if length == 0:
    print(sum(mod[:n]))
else:
    t = (n-i)//length
    amari = (n-i) % length
    ans = sum(before) + t * sum(loop) + sum(loop[:amari])
    print(ans)


Fixed submission:
n, x, m = map(int, input().split())
a = x
dup = [0]*(10**5+10)
mod = [a]
loop = []
cnt = 0
while cnt < n:
    a = a**2 % m
    if dup[a]==1:
        i = mod.index(a)
        before = mod[:i]
        loop = mod[i:]
        break
    mod.append(a)
    dup[a] = 1
    cnt += 1

length = len(loop)
if length == 0:
    print(sum(mod[:n]))
else:
    t = (n-i)//length
    amari = (n-i) % length
    ans = sum(before) + t * sum(loop) + sum(loop[:amari])
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
ans = 0
mod = 7+10**9
for i in range(n-1):
    for j in range(i+1,n):
        ans += A[i]*A[j]
        ans %= mod
print(ans)

Fixed submission:
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())),dtype=np.longlong)
mod = 7+10**9
cs = 0
for a in A:
    cs += a
    cs %= mod
cumsum = np.mod(np.cumsum(A),mod)
rev = -1*(cumsum-cs)
ans = 0
for i in range(n-1):
    ans += rev[i]*A[i]
    ans %= mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
x, k, d = map(int, input().split())
if x < 0:
    x *= -1
cnt = 0
while x > 0 and cnt < k:
    x -= d
    cnt += 1
if abs(x) < x+d:
    x += d
    cnt -= 1
    x -= d * ((k-cnt)%2)
else:
    x += d * ((k-cnt)%2)
print(abs(x))

Fixed submission:
x, k, d = map(int, input().split())
if x < 0:
    x *= -1
cnt = min(k, x//d+1)
x -= cnt * d
if abs(x) < x+d:
    x += d
    cnt -= 1
    x -= d * ((k-cnt)%2)
else:
    x += d * ((k-cnt)%2)
print(abs(x))
Buggy python submission (verdict: Runtime Error):
n = int(input())
di = {}
li = []
ans = ""
for i in range(26):
    di[i+1] = chr(i+97)
while n != 0:
    li.append(di[n % 26])
    n = n // 26
for c in reversed(li):
    ans += c
print(ans)


Fixed submission:
n = int(input())
ans = ""
while n != 0:
    n -= 1
    ans += chr(97 + n%26)
    n = n//26
for c in reversed(ans):
    print(c, end="")
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
n = int(input())
# 素因数分解
s = math.sqrt(n)
i = 2
f = np.zeros(n)
while i <= s:
    while n % i == 0:
        f[i-1] += 1
        n = n // i
    i += 1

ans = 0
for x in f:
    e = 0
    while x > 0:
        e += 1
        x -= e
    ans += e
print(ans)

Fixed submission:
import math
import numpy as np
n = int(input())

s = math.sqrt(n)
i = 2
f = {}
while i <= s:
    while n % i == 0:
        f[i] = f.get(i,0)+1
        n = n // i
    i += 1

ans = 0
for x in f.values():
    e = 0
    cumsum = 0
    while e + cumsum + 1 <= x:
        e += 1
        cumsum += e
    ans += e
print(ans+(n>1))