Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02984 (python)

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

M_1 = 0
for i,val in enumerate(dums):
    i+=1
    if i%2==1:
        M_1 += val
    else:
        M_1 -= val

out_dict = {i+1:0 for i in range(N)}
out_dict[1] = M_1

for i in range(1,N):
    out_dict[i+1] = 2*dums[i-1] - out_dict[i]

print(" ".join(list(map(str, out_dict.values()))))

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

M_1 = 0
for i,val in enumerate(dums):
    i+=1
    if i%2==1:
        M_1 += val
    else:
        M_1 -= val

out_dict = {i+1:0 for i in range(N)}
out_dict[1] = M_N

for i in range(1,N):
    out_dict[i+1] = 2*dums[i-1] - out_dict[i]

print(" ".join(list(map(str, out_dict.values()))))
Problem p03013 (python)

Fixed submission:

N, M=map(int, input().split())
A = [int(input()) for i in range(M)]

def fib(x):
    a = 1
    b = 1
    if x == 0:
        return 0
    elif x == 1:
        return a
    elif x == 2:
        return b
    else:
        for i in range(x-2):
            c = a + b
            a = b
            b = c
        return b 

before_a=1
output=1
if M>=1:
    output = fib(A[0])
    for i in range(M-1):
        output *= fib(A[i+1]-A[i]-1)
    output *= fib(N-A[M-1])
else:
    output *= fib(N+1)
print(output%1000000007)

Buggy submission (verdict: Runtime Error):

N, M=map(int, input().split())
A = [int(input()) for i in range(M)]

def fib(x):
    a = 1
    b = 1
    if x == 0:
        return 0
    elif x == 1:
        return a
    elif x == 2:
        return b
    else:
        for i in range(x-2):
            c = a + b
            a = b
            b = c
        return b 

before_a=1
output = fib(A[0])
if M>=1:
    for i in range(M-1):
        output *= fib(A[i+1]-A[i]-1)
    output *= fib(N-A[M-1])
else:
    output *= fib(N+1)
print(output%1000000007)

Buggy submission (verdict: Runtime Error):
import numpy as np

N, M=map(int, input().split())
A = [int(input()) for i in range(M)]

def fib(n):
    x =np.sqrt(5) 
    return int(1/x * ( ((1+x)/2)**n - ((1-x)/2)**n ) )

before_a=0
output = 1
A.append(N)
for a in A:
    sa = a-before_a
    before_a = a
    output *= fib(sa)

for i in range(len(A)-1):
    if A[i]+1 == A[i+1]:
        output=0
        break
print(output%1000000007)
Problem p03804 (python)

Fixed submission:
import numpy as np

N,M = map(int, input().split())

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

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False

  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    try:
        if (A == B).all():
            print("Yes")
        else:
            print("No")
    except:
        print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np

N,M = map(int, input().split())

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

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False

  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    if (A == B).all():
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np

N,M = map(int, input().split())

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

B=[]
for j in range(M):
    B.append(list(input()))

A=np.asarray(A)
B=np.asarray(B)
flg=False
if (A == B).all():
    flg=True
  
for x in range(N-M):
    for y in range(N-M):
        if (A[x:x+M,y:y+M] == B).all():
            flg=True
if flg:
    print("Yes")
else:
    print("No")
Problem p03835 (python)

Fixed submission:
data = input().split(" ")
data = list(map(int, data))

count=0

for x in range(data[0]+1):
    for y in range(data[0]+1):
        if data[0] >= (data[1]-(x+y)) >= 0:
            z = data[1]-(x+y)
            
            if x + y + z == data[1]:
                count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import numpy as np

def count_true(matrix:np.array, s:int):
    return np.count_nonzero(matrix == s)


def unk(k:int, s:int):
    # 条件チェック
    if all([(2 <= k <= 2000), (0 <= s <= 3*k)]):

        x = y = z = np.array([range(0,k+1)])
        c = count_true(np.ravel(x.T+y)+ z.T, s)

        print(c)


if __name__ == '__main__':
    data = input().split(" ")
    data = list(map(int, data))
    unk(data[0], data[1])

Buggy submission (verdict: Runtime Error):
import numpy as np

def count_true(matrix:np.array, s:int):
    return np.count_nonzero(matrix == s)


def unk(k:int, s:int):
    # 条件チェック
    if all([(2 <= k <= 2000), (0 <= s <= 3*k)]):

        x = y = z = np.array([range(0,k+1)])
        c = count_true(np.ravel(x.T+y)+ z.T, s)

        print(c)


if __name__ == '__main__':
　　　　data = input().split(" ")
　　　　data = list(map(int, data))
　　　　unk(data[0], data[1])
Problem p02699 (python)

Fixed submission:
s, w = map(int, (input().split()))

if s > w :
    print("safe")
else :
    print("unsafe")

Buggy submission (verdict: Runtime Error):
s = int(input())
w = int(input())
if s < w :
    print("unsafe")
else :
    print("safe")
Problem p03072 (python)

Fixed submission:
def B():
    N = int(input())
    H = [int(i) for i in input().split()]
    if  not len(H) == N:
        exit()
    max_high = max(H)
    max_index = H.index(max_high)

    count = 0
    count += H.count(max_high)

    pmax = H[0]
    for i in range(max_index):
        if pmax <= H[i]:
            pmax = H[i]
            count += 1
        
    print(count)

if __name__ == '__main__':
    B()

Buggy submission (verdict: Runtime Error):
def B():
    N = input()
    H = [int(i) for i in input().split()]
    max_high = max(H)
    max_index = H.index(max_high)

    count = 0
    count += H.count(max_high)

    pmax = H[0]
    for i in range(max_index):
        if pmax <= H[i]:
            pmax = H[i]
            count += 1
        
    print(count)
    
   
  if __name__ == '__main__':
    B()
Problem p03307 (python)

Fixed submission:

if __name__ =='__main__':
    a = input()
    try:
        x = int(a)
    except:
        exit(1)

    if(x % 2 != 0):
         x = x*2
    
    print(x)

Buggy submission (verdict: Runtime Error):
def B():
    n = int(input())
    a = input().split()
    
    if(len(a) != n):
        exit(1)

    i_max = 0
    i_min = 1000000001
    for i in a:
        k = int(i)
        if (i_max < k):
                i_max = k
        if (i_min > k):
                i_min = k
    print(i_max,i_min)
    print(abs( i_max - i_min))

if __name__ =='__main__':
    B()
Problem p02880 (python)

Fixed submission:
def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False
  
n = int(input())

flag=0
for i in range(1, 10):
    m = n/i
    if is_integer_num(m) and m<10:
        flag = 1
        print("Yes")
        break
if flag == 0:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())

flag = 0
for i in range(1, 10):
    m = n/i
    try:
        m = int(m)
        if m < 10:
          flag = 1
            print("Yes")
            break
    except:
        continue
if flag ==0:
    print("No")
Problem p02881 (python)

Fixed submission:
n=int(input())
for i in range(int(n**0.5),0,-1):
    if n%i==0:
        print(i+n//i-2)
        exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(int(n**0.5),0,-1):
    if n%i==0:
        ptint(i+n//1)
        exit()
Problem p02915 (python)

Fixed submission:
n=int(input())

print(n**3)

Buggy submission (verdict: Runtime Error):
print(int(input()**3)
Problem p02948 (python)

Fixed submission:
import heapq
n,m=map(int,input().split())
ab=[[0]*2 for _ in range(n)]


for i in range(n):
    ab[i]=list(map(int,input().split()))
ab.sort()
hq=[]
tmp=0
ans=0
for i in range(1,m+1):
    while tmp<n and ab[tmp][0]<=i:
        heapq.heappush(hq,-ab[tmp][1])
        tmp+=1
    if hq:
        ans-=heapq.heappop(hq)
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq
n,m=map(int,input().split())
ab=[[0]*2 for _ in range(n)]


for i in range(n):
    ab[i]=list(map(int,input().split()))
ab.sort()
hq=[]
tmp=0
ans=0
for i in range(1,m+1):
    while tmp<n and ab[tmp][0]<=i:
        heapq.heappush(hq,-ab[tmp][1])
        tmq+=1
    if hq:
        ans-=heapq.heappop(hq)
print(ans)
Problem p02987 (python)

Fixed submission:
s=list(input())
s.sort()
flag=True
if s[0]==s[1]:
    if s[1]!=s[2]:
        if s[2]==s[3]:
            print("Yes")
            flag=False
if flag:
    print("No")

Buggy submission (verdict: Runtime Error):
s=int(input())
s.sort()
flag=True
if s[0]==s[1]:
    if s[1]!=s[1]:
        if s[2]==s[3]:
            print("Yes")
            flag=False
if flag:
    print("No")
Problem p03038 (python)

Fixed submission:
N,M=map(int,input().split())
A=list(map(int,input().split()))
BC=[list(map(int,input().split())) for _ in range(M)]
A.sort()
BC.sort(key=lambda x:-x[1])

B=[]
for bc in BC:
    B+=[bc[1]]*bc[0]
    if len(B)>=N:
        break
B+=[0]*(N-len(B))
print(sum([max(A[i],B[i]) for i in range(N)]))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
A=list(map(int,input().split()))
BC=[list(map(int,input().split())) for _ in range(m)]
A.sort()
BC.sort(key=lambda x:-x[1])

B=[]
for bc in BC:
    B+=[bc[1]]*bc[0]
    if len(B)>=N:
        break
B+=[0]*(N-len(B))
print(sum([max(A[i],B[i]) for i in range(N)]))
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if max(a,b,c,d,e)-min(a,b,c,d,e)<=k:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if mac(a,b,c,d,e)-min(a,b,c,d,e)<=k:
    print("Yay!")
else:
    print(":(")
Problem p03104 (python)

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

def xor(n):
    ret=0
    i=1
    while True:
        div,mod=divmod(n,i)
        flg=i*(div//2)
        if div%2==1:
            flg+=(mod+1)
        if flg%2==1:
            ret+=i
        i*=2
        if i>n:
            break
    return ret
print(xor(a-1)^xor(b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())

def xor(n):
    ret=0
    i=1
    while True:
        div,mod=divmod(n,i)
        flg=i*(div//2)
        if div%2==1:
            flag+=(mod+1)
        if flg%2==1:
            ret+=i
        i*=2
        if i>n:
            break
    return ret
print(xor(a-1)^xor(b))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input.split())

def xor(n):
    ret=0
    i=1
    while True:
        div,mod=divmod(n,i)
        flg=i*(div//2)
        if div%2==1:
            flag+=(mod+1)
        if flg%2==1:
            ret+=i
        i*=2
        if i>n:
            break
    return ret
print(xor(a-1)^xor(b))
Problem p03127 (python)

Fixed submission:
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in range(1,n):
    ans=gcd(ans,a[i])
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=a[0]
for i in range(1,n):
    ans=gcd(ans,a[i])
print(ans)
Problem p03221 (python)

Fixed submission:
n,m=map(int,input().split())
P=[[] for _ in range(n+1)]
for i in range(m):
    p,y=map(int,input().split())
    P[p].append([y,i+1])
ans=[]
for j in range(n+1):
    if P[j]:
        P[j].sort()
        for i in range(len(P[j])):
            #print(P[j])
            ans.append([P[j][i][1],str((j*10**6+i+1)).zfill(12)])
ans.sort()
for i in range(m):
    print(ans[i][1])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
P=[[] for _ in range(n+1)]
for i in range(m):
    p,y=map(int,input().split())
    P[p].append([y,i+1])
ans=[]
for j in range(m):
    if P[j]:
        P[j].sort()
        for i in range(len(P[j])):
            #print(P[j])
            ans.append([P[j][i][1],str((j*10**6+i+1)).zfill(12)])
ans.sort()
for i in range(m):
    print(ans[i][1])
Problem p03250 (python)

Fixed submission:
a=list(map(int,input().split()))
a.sort()
print(a[2]*10+a[1]+a[0])

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split())).sort()
print(a[2]*10+a[1]+a[0])
Problem p03286 (python)

Fixed submission:
N=int(input())
if N==0:print(0)
ans=""
while N!=0:
    r=N%2
    N=(N-r)//(-2)
    ans+=str(r)
ans=ans[::-1]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==0:print(0)
bi=''
while n!=0:
    bi+=str(n%abs(k))
    if k<0:n=-(-n//k)
    else:n=n//k
print(bi[::-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
if N==0:print(0)
bi=''
while n!=0:
    bi+=str(n%abs(k))
    if k<0:n=-(-n//k)
    else:n=n//k
print(bi[::-1])
Problem p03315 (python)

Fixed submission:
s=input()
n=0
for i in range(len(s)):
    if s[i]=="+":
        n+=1
print(n-(4-n))

Buggy submission (verdict: Runtime Error):
s=input()
n=0
for i in range(s):
    if s[i]=="+":
        n+=1
print(n-(4-n))
Problem p03326 (python)

Fixed submission:
N,M=map(int,input().split())
cake=[list(map(int,input().split())) for _ in range(N)]
ans=0
for i in range(1<<3):
    point=[0]*N
    for j in range(N):
        for k in range(3):
            point[j]+=(-1+(i>>k & 1)*2)*cake[j][k]
    point.sort()
    ans=max(ans,sum(point[-M:]))
    if M==0:
        ans=0
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
cake=[list(map(int,input().split())) for _ in range(N)]
ans=0
if M=0:
    print(ans)
    exit()
for i in range(1<<3):
    point=[0]*N
    for j in range(N):
        for k in range(3):
            point[j]+=(-1+(i>>k & 1)*2)*cake[j][k]
    point.sort()
    ans=max(ans,sum(point[-M:]))
print(ans)
Problem p03806 (python)

Fixed submission:
import sys
input = sys.stdin.readline
n,ma,mb=map(int,input().split())
dp=[[[float("inf")]*500 for _ in range(500)] for i in range(n+1)]
dp[0][0][0]=0
for i in range(n):
    a,b,c=map(int,input().split())
    for j in range(450):
        for k in range(450):
            dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])
            dp[i+1][j+a][k+b]=min(dp[i+1][j+a][k+b],dp[i][j][k]+c)
ans=float("inf")
i=1
#print(dp[-1])
while i*ma<450 and i*mb<450:
    ans=min(ans,dp[-1][ma*i][mb*i])
    i+=1
print(ans if ans!=float("inf") else -1)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n,ma,mb=map(int,input().split())
dp=[[[float("inf")]*500 for _ in range(500)] for i in range(n+1)]
dp[0][0][0]=0
for i in range(n):
    a,b,c=map(int,input().split())
    for j in range(450):
        dp[i+1][j][k]=min(dp[i+1][j][k],dp[i][j][k])
        for k in range(450):
            dp[i+1][j+a][k+b]=min(dp[i+1][j+a][k+b],dp[i][j][k]+c)
ans=float("inf")
i=1
#print(dp[-1])
while i*ma<450 and i*mb<450:
    ans=min(ans,dp[-1][ma*i][mb*i])
    i+=1
print(ans if ans!=float("inf") else -1)
Problem p02773 (python)

Fixed submission:
from collections import Counter

N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

Buggy submission (verdict: Runtime Error):
d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)
Problem p03329 (python)

Fixed submission:
import sys


sys.setrecursionlimit(1000000)


MAX_N = 100001

memo = [-1] * MAX_N


def f(n):
    # 残り金額が0なら引き出す必要がないので0(再帰の終端条件)
    if n == 0:
        return 0
    # すでに探索済みならメモを参照する
    if memo[n] != -1:
        return memo[n]

    res = sys.maxsize

    pow9 = 1
    while pow9 <= N:
        if n - pow9 < 0:
            break
        res = min(res, f(n-pow9)+1)
        pow9 *= 9


    pow6 = 1
    while pow6 <= N:
        if n - pow6 < 0:
            break
        res = min(res, f(n-pow6)+1)
        pow6 *= 6

    # メモ
    memo[n] = res

    return res


if __name__ == '__main__':
    N = int(input())

    print(f(N))

Buggy submission (verdict: Runtime Error):
import sys


sys.setrecursionlimit(100000)


MAX_N = 100001

memo = [-1] * MAX_N


def f(n):
    # 残り金額が0なら引き出す必要がないので0(再帰の終端条件)
    if n == 0:
        return 0
    # すでに探索済みならメモを参照する
    if memo[n] != -1:
        return memo[n]

    res = sys.maxsize

    pow9 = 1
    while pow9 <= N:
        if n - pow9 < 0:
            break
        # print(n)
        # print(pow9)
        res = min(res, f(n-pow9)+1)
        pow9 *= 9

    pow6 = 1
    while pow6 <= N:
        if n - pow6 < 0:
            break
        res = min(res, f(n-pow6)+1)
        pow6 *= 6

    # メモ
    memo[n] = res

    return res


if __name__ == '__main__':
    N = int(input())

    print(f(N))

Buggy submission (verdict: Runtime Error):
import sys


sys.setrecursionlimit(1000000)


MAX_N = 100000

memo = [-1] * MAX_N


def f(n):
    # 残り金額が0なら引き出す必要がないので0(再帰の終端条件)
    if n == 0:
        return 0
    # すでに探索済みならメモを参照する
    if memo[n] != -1:
        return memo[n]

    res = sys.maxsize

    pow9 = 1
    while pow9 <= N:
        if n - pow9 < 0:
            break
        res = min(res, f(n-pow9)+1)
        pow9 *= 9


    pow6 = 1
    while pow6 <= N:
        if n - pow6 < 0:
            break
        res = min(res, f(n-pow6)+1)
        pow6 *= 6

    # メモ
    memo[n] = res

    return res


if __name__ == '__main__':
    N = int(input())

    print(f(N))

Buggy submission (verdict: Runtime Error):
import sys


sys.setrecursionlimit(100000)


MAX_N = 100000

memo = [-1] * MAX_N


def f(n):
    # 残り金額が0なら引き出す必要がないので0(再帰の終端条件)
    if n == 0:
        return 0
    # すでに探索済みならメモを参照する
    if memo[n] != -1:
        return memo[n]

    res = sys.maxsize

    pow9 = 1
    while pow9 <= N:
        if n - pow9 < 0:
            break
        # print(n)
        # print(pow9)
        res = min(res, f(n-pow9)+1)
        pow9 *= 9

    pow6 = 1
    while pow6 <= N:
        if n - pow6 < 0:
            break
        res = min(res, f(n-pow6)+1)
        pow6 *= 6

    # メモ
    memo[n] = res

    return res


if __name__ == '__main__':
    N = int(input())

    print(f(N))
Problem p03011 (python)

Fixed submission:
p, q, r =(int(i) for i in input().split())
ans1=p+q
ans2=q+r
ans3=p+r

if ans1<=ans2 and ans1<=ans3:
    print(ans1)
elif ans2<= ans1 and ans2 <= ans3:
    print(ans2)
else:
    print(ans3)

Buggy submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
ans=100000000;
s1=0
s2=0
 
for i in range(n):
    s1 += sum(w[:i+1])
    s2 += sum(w[i+1:])
            
    if abs(s1-s2) < ans:
        ans = abs(s1-s2)
    
print(ans)
Problem p03012 (python)

Fixed submission:
n=int(input())
w=list(map(int,input().split()))
ans=[]
s1=0
s2=0
 
for i in range(n):
    for j in range(0,i):
        s1 += w[j]
    for k in range(i,n):
        s2 += w[k]
    ans.append(abs(s1 - s2))
    s1=0
    s2=0
    
print(min(ans))

Buggy submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
ans=10000;

 
for i in range(n):
    s1 += sum(w[:i+1])
    s2 += sum(w[i+1:])
            
    if abs(s1-s2) < ans:
        ans = abs(s1-s2)
    
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
w=list(map(int,input().split()))
ans=100000000;

 
for i in range(n):
    s1 += sum(w[:i+1])
    s2 += sum(w[i+1:])
            
    if abs(s1-s2) < ans:
        ans = abs(s1-s2)
    
print(ans)
Problem p02729 (python)

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

print(N*(N-1)//2+M*(M-1)//2)

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

print(N(N-1)//2+M(M-1)//2)
Problem p03775 (python)

Fixed submission:
N = int(input())
count = []

for a in range(1,int(N**0.5+1)):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
count = []

for a in range(1,N//2+1):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))
Problem p02624 (python)

Fixed submission:
n = int(input())
ans = 0
for i in range(1, n + 1):
    y = n // i
    ans += y * (y + 1) * i // 2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

import sympy
sympy.divisors(10**9)

def m(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return len(lower_divisors) + len(upper_divisors[::-1])

ans = 0
for i in range(1, n+1):
    ans += i * m(i)
print(ans)
Problem p02629 (python)

Fixed submission:
N = int(input()) 
ans = '' 
while N > 0:
  N -= 1 
  ans += chr(ord('a') + N % 26)
  N //= 26 
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
def B(X, n):
    X_dumy = X
    ln = []
    while X_dumy>0:
        ln.append(int(X_dumy%n))
        X_dumy = int(X_dumy/n)
    ln.reverse()
    return ln
ln = B(n, 26)
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
q = []
print(ln)
for i in range(len(ln)):
    if ln[i] == 1 and ln[i] < ln.index(0):
        q.append('z')
    elif ln[i] != 0:
        q.append(a[ln[i] - 1])
print(''.join(q))
Problem p02754 (python)

Fixed submission:
import sys
n, a, b = map(int, input().split())
if a == 0 or n == 0:
    print(0)
    sys.exit()
j = n //(a + b)

if n - (a + b) * j >= a:
    print(a * j + a)
    sys.exit()
else:
    print(a * j + n- (a + b)*j )
    sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
n, a, b = map(int, input().split())
if (a + b) * (10**100) <= n:
    print(a * (10**100))
    sys.exit()
else:
    for i in range(n):
        if (a + b) * i <= n < (a + b) * (i + 1):
            j = i
            break
if n - (a + b) * j >= a:
    print(a * j + a)
    sys.exit()
else:
    print(a * j +n-(a + b)*j )
    sys.exit()
Problem p02773 (python)

Fixed submission:
n = int(input())
p = [str(input()) for _ in range(n)]
import collections
c = collections.Counter(p)
m = max(c.values())
keys = [k for k, v in c.items() if v == m]
keys.sort()
for i in keys:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [str(input()) for _ in range(n)]
import collections
c = collections.Counter(p)
m = max(c.values())
keys = [k for k, v in d.items() if v == m]
keys.sort()
for i in keys:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [str(input()) for _ in range(n)]
import collections
c = collections.Counter(p)
m = max(c.values())
keys = [k for k, v in d.items() if v == m]
sorted(keys)
for i in keys:
    print(i)