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

Fixed submission:
import math

N = int(input())

#f(n) を以下の 2 つの条件の両方を満たすような 3 つの整数の組 (x,y,z)の個数とします。
# 1≤x,y,z
# x**2 + y**2 + z**2 + xy + yz + zx = n

# x,y,zの最大値を考える。
# x**2 + 1**2 + 1**2 + x + 1 + x = n
# x**2 + 2x = n - 3
# x**2 + 2x -n + 3 = 0
# x = {-2 ± sqrt(2**2 - 4*1*(-n+3))}/2*1
# x = {-2 ± sqrt(4 + 4n -12)}/2
# 1 ≤ xより
# x = {-2 + sqrt(4n - 8)}/2 = {-2 + 2 * sqrt(n - 2)}/2 = -1 + sqrt(n - 2)
# ∴ 1 ≤ x ≤ math.floor(-1 + sqrt(n - 2))
# y,zも同様。
# N <= 10**4 より、x,y,xで全探索しても(10**2)**3 = 10**6 で間に合う

ans_dict = {i:set() for i in range(1,N+1)}

if N != 1:
    for i in range(1,1 + math.floor(-1 + math.sqrt(N - 2))):
        for j in range(1,1 + math.floor(-1 + math.sqrt(N - 2))):
            for k in range(1,1 + math.floor(-1 + math.sqrt(N - 2))):
                n = i**2 + j**2 + k**2 + i*j + j*k + k*i
                if 1 <= n <= N:
                    ans_dict[n].add((i,j,k))
                
    for i in range(1,N+1):
        print(len(ans_dict[i]))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())

#f(n) を以下の 2 つの条件の両方を満たすような 3 つの整数の組 (x,y,z)の個数とします。
# 1≤x,y,z
# x**2 + y**2 + z**2 + xy + yz + zx = n

# x,y,zの最大値を考える。
# x**2 + 1**2 + 1**2 + x + 1 + x = n
# x**2 + 2x = n - 3
# x**2 + 2x -n + 3 = 0
# x = {-2 ± sqrt(2**2 - 4*1*(-n+3))}/2*1
# x = {-2 ± sqrt(4 + 4n -12)}/2
# 1 ≤ xより
# x = {-2 + sqrt(4n - 8)}/2 = {-2 + 2 * sqrt(n - 2)}/2 = -1 + sqrt(n - 2)
# ∴ 1 ≤ x ≤ math.floor(-1 + sqrt(n - 2))
# y,zも同様。
# N <= 10**4 より、x,y,xで全探索しても(10**2)**3 = 10**6 で間に合う

ans_dict = {i:set() for i in range(1,N+1)}

for i in range(1,1 + math.floor(-1 + math.sqrt(N - 2))):
    for j in range(1,1 + math.floor(-1 + math.sqrt(N - 2))):
        for k in range(1,1 + math.floor(-1 + math.sqrt(N - 2))):
            n = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if 1 <= n <= N:
                ans_dict[n].add((i,j,k))
            
for i in range(1,N+1):
    print(len(ans_dict[i]))
Problem p02615 (python)

Fixed submission:
from collections import deque

N = int(input())
A = [int(e) for e in input().split()]


A.sort(reverse=True)

if N == 2:
    print(A[0])
else:
    ans = A[0]
    friendly_deque = deque()
    friendly_deque.append(A[1])
    friendly_deque.append(A[1])
    
    for i in range(2,N):
        add = friendly_deque.popleft()
        ans += add
        friendly_deque.append(A[i])
        friendly_deque.append(A[i])

    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

N = int(input())
A = [int(e) for e in input().split()]

A.sort(reverse=True)

if N == 2:
    print(A[1])
else:
    ans = A[0]
    friendly_deque = deque()
    friendly_deque.append(A[1])
    friendly_deque.append(A[1])
    
    #print(ans,friendly_deque)
    
    for i in range(2,N):
        add = friendly_deque.popleft()
        ans += add
        friendly_deque.append(A[i])
        friendly_deque.append(A[i])
        #print(ans,friendly_deque)
print(ans)
Problem p02678 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)

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

room_and_connecting_room_dict = {i:set() for i in range(1,N+1)}

for i in range(M):
    A,B = map(int, input().split())
    room_and_connecting_room_dict[A].add(B)
    room_and_connecting_room_dict[B].add(A)

def get_child_ans(room_numbers_set): #room_number_list:前の部屋番の子ども全て
    
    next_room_numbers_set = set()
    
    for room_number in room_numbers_set:
        for child_room in room_and_connecting_room_dict[room_number]:
            if child_room not in calculated_room_numbers_set:
                ans_dict[child_room] = room_number #前の部屋番の子供は全て、前の部屋番に回答が確定する
                next_room_numbers_set.add(child_room)
                calculated_room_numbers_set.add(child_room)
 
    #終了判定
    if len(calculated_room_numbers_set) == N: #全部計算済み
        return 1
    elif len(next_room_numbers_set) == 0: #1から繋がる全てを計算したのに未計算がある
        return -1
    else: #孫がいるのでまだやる
        return get_child_ans(next_room_numbers_set)

ans_dict = dict()
ans_dict[1] = 0
calculated_room_numbers_set = set()
calculated_room_numbers_set.add(1)

is_there_ans = get_child_ans(set([1]))  

if is_there_ans == 1:
    print("Yes")
    for i in range(2,N+1):
        print(ans_dict[i])
else:
    print("No")

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

room_and_connecting_room_dict = {i:set() for i in range(1,N+1)}

for i in range(M):
    A,B = map(int, input().split())
    room_and_connecting_room_dict[A].add(B)
    room_and_connecting_room_dict[B].add(A)

def get_child_ans(room_numbers_set): #room_number_list:前の部屋番の子ども全て
    
    next_room_numbers_set = set()
    
    for room_number in room_numbers_set:
        for child_room in room_and_connecting_room_dict[room_number]:
            if child_room not in calculated_room_numbers_set:
                ans_dict[child_room] = room_number #前の部屋番の子供は全て、前の部屋番に回答が確定する
                next_room_numbers_set.add(child_room)
                calculated_room_numbers_set.add(child_room)
 
    #終了判定
    if len(calculated_room_numbers_set) == N: #全部計算済み
        return 1
    elif len(next_room_numbers_set) == 0: #1から繋がる全てを計算したのに未計算がある
        return -1
    else: #孫がいるのでまだやる
        return get_child_ans(next_room_numbers_set)

ans_dict = dict()
ans_dict[1] = 0
calculated_room_numbers_set = set()
calculated_room_numbers_set.add(1)

is_there_ans = get_child_ans(set([1]))  

if is_there_ans == 1:
    print("Yes")
    for i in range(2,N+1):
        print(ans_dict[i])
else:
    print("No")
Problem p02683 (python)

Fixed submission:
N,M,X = map(int, input().split())
CA_array = list()
for i in range(N):
    CA_list = [int(e) for e in input().split()]
    CA_array.append(CA_list)
    
ans = 13*(10**5)
    
#N<=12なので全探索しても4096.全探索する。
for i in range(2**(N)): #4096
    bit_array = str(bin(i)[2:]).zfill((N))
    #print(bit_array)

    CA_on_bit_array = [0 for _ in range(M+1)]
    
    for j in range(len(bit_array)): #12

        if bit_array[j]=="0":
            #OFF時の処理
            pass
        elif bit_array[j]=="1":
            #ON時の処理
            for k in range(M+1): #13
                CA_on_bit_array[k] += CA_array[j][k]

    #ON・OFFの状態設定後の処理
    for k in range(1,M+1):
        if CA_on_bit_array[k] < X:
            break
    else:
        if CA_on_bit_array[0] < ans:
            ans = CA_on_bit_array[0]

if ans != 13*(10**5):
    print(ans)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int, input().split())
if K<=A:
    print(K)
elif A<=K<=A+B:
    print(A)
else:
    print(A-(K-A-B))
    
    
    
    
N,M,X = map(int, input().split())
CA_array = list()
for i in range(N):
    CA_list = [int(e) for e in input().split()]
    CA_array.append(CA_list)
    
ans = 13*(10**5)
    
#N<=12なので全探索しても4096.全探索する。
for i in range(2**(N)): #4096
    bit_array = str(bin(i)[2:]).zfill((N))
    #print(bit_array)

    CA_on_bit_array = [0 for _ in range(M+1)]
    
    for j in range(len(bit_array)): #12

        if bit_array[j]=="0":
            #OFF時の処理
            pass
        elif bit_array[j]=="1":
            #ON時の処理
            for k in range(M+1): #13
                CA_on_bit_array[k] += CA_array[j][k]

    #ON・OFFの状態設定後の処理
    for k in range(1,M+1):
        if CA_on_bit_array[k] < X:
            break
    else:
        if CA_on_bit_array[0] < ans:
            ans = CA_on_bit_array[0]

if ans != 13*(10**5):
    print(ans)
else:
    print(-1)
Problem p02719 (python)

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

x = abs(N - K*(int(N/K)-1))
ans = N

for i in range(0,100000):
    x = abs(x-K)
    ans = min(ans,x)

print(ans)

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

x = abs(N - K*(int(N/K)-1))

for i in range(0,5):
    x = abs(x-K)
    ans = min(ans,x)

print(ans)
Problem p02720 (python)

Fixed submission:
#161d
import math
import copy

K = int(input())

keta = 1
lunlun_numbers_list = [1,2,3,4,5,6,7,8,9]
lunlun_numbers_numer = 9

if K <=9:
    print(lunlun_numbers_list[K-1])
else:
    while 1:
        new_lunlun_numbers_list = list()
        for lower_keta in lunlun_numbers_list:
            ketasu = int(math.log10(lower_keta)//1 + 1)

            if lower_keta>=10:
                last_keta = lower_keta - ((lower_keta//10) * 10)
            else:
                last_keta = lower_keta

            #print(lower_keta,ketasu,last_keta)

            if last_keta !=0: 
                new_lunlun_numbers_list.append(lower_keta*10 + last_keta - 1)
            
            new_lunlun_numbers_list.append(lower_keta*10 + last_keta)

            if last_keta !=9:
                new_lunlun_numbers_list.append(lower_keta*10 + last_keta + 1)

        if len(new_lunlun_numbers_list)+lunlun_numbers_numer >= K:
            new_lunlun_numbers_list.sort(reverse=False)
            print(new_lunlun_numbers_list[K-lunlun_numbers_numer-1])
            #print(new_lunlun_numbers_list)
            break
        else:
            lunlun_numbers_numer+=len(new_lunlun_numbers_list)

        lunlun_numbers_list = copy.copy(new_lunlun_numbers_list)

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

def get_next_lun(before_number,keta):  

  if keta == 1: #終了条件を忘れない
      if before_number == 9:
        return [8,9]
      if before_number == 0:
        return [1,2]
      else:
        return [before_number-1,before_number,before_number+1]
  else:
      if before_number == 9:
        for i in get_next_lun(before_number,keta-1):
        return []
      if before_number == 0:
        return []
      else:
        return [before_number-1,before_number,before_number+1]
      
      return
Problem p02732 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000000)

from operator import mul
from functools import reduce
from functools import lru_cache

N = int(input())
A_list = [int(e) for e in input().split()]

#ある番号のボールが何個あるかをまとめる
number_dict = dict()

for i in range(N):
    ball_number = A_list[i]
    if ball_number not in number_dict:
        number_dict[ball_number] = 0
        
    number_dict[ball_number] += 1

#それぞれの番号のボールから2個選ぶ組み合わせをカウントする。
comb_dict = dict()

@lru_cache(maxsize=10000000000000)
def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom
    
@lru_cache(maxsize=10000000000000)
def two_choice(N):
    if N == 2:
        return 1
    elif N <= 1:
        return 0
    elif N == 3:
        return 3
    else:
        return combinations_count(N,2)

all = 0

for in_dict in number_dict.items():
    ball_number = in_dict[0]
    balls = in_dict[1]
    comb_dict[ball_number] = two_choice(balls)
    all += comb_dict[ball_number]

#回答作成
for i in range(1,N+1):
    ball_number = A_list[i-1]
    now_balls = number_dict[ball_number] - 1
    print(int(all-comb_dict[ball_number]+two_choice(now_balls)))

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000000000000)

from operator import mul
from functools import reduce
from functools import lru_cache

N = int(input())
A_list = [int(e) for e in input().split()]

#ある番号のボールが何個あるかをまとめる
number_dict = dict()

for i in range(N):
    ball_number = A_list[i]
    if ball_number not in number_dict:
        number_dict[ball_number] = 0
        
    number_dict[ball_number] += 1

#それぞれの番号のボールから2個選ぶ組み合わせをカウントする。
comb_dict = dict()

@lru_cache(maxsize=10000000000000)
def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom
    
@lru_cache(maxsize=10000000000000)
def two_choice(N):
    if N == 2:
        return 1
    elif N <= 1:
        return 0
    elif N == 3:
        return 3
    else:
        return combinations_count(N,2)*combinations_count(N-2,2)

all = 0

for in_dict in number_dict.items():
    ball_number = in_dict[0]
    balls = in_dict[1]
    comb_dict[ball_number] = two_choice(balls)
    all += comb_dict[ball_number]

#回答作成
for i in range(1,N+1):
    ball_number = A_list[i-1]
    now_balls = number_dict[ball_number] - 1
    print(int(all-comb_dict[ball_number]+two_choice(now_balls)))
Problem p02741 (python)

Fixed submission:
a_list =[1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51]
K = int(input())
print(a_list[K-1])

Buggy submission (verdict: Runtime Error):
a_list =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
print(a_list[K+1])
Problem p02744 (python)

Fixed submission:
N = int(input())

#文字数分aで埋める
#末尾をbにする
#一桁上の文字+1文字までは許容するルールで増加させていく

ans = [0 for _ in range(N)]
stop = [i for i in range(N)]

def ans_print(ans_list):
    ans = list()
    for a in ans_list:
        ans.append(chr(a+97)) #97でaが出る

    print(''.join(map(str, ans)))
    return 0

def ans_check(ans):
    max_in_ans = 0

    for i in range(1,N):
        if max_in_ans + 1 < ans[i]:
            ans[i-1] += 1
            ans[i] = 0
            return ans_check(ans)
        else:
            max_in_ans = max(max_in_ans,ans[i])
    else:
        return ans

if N == 1:
    print("a")
else:
    while 1:
        ans_check(ans)
        ans_print(ans)
        ans[-1] += 1
        if ans == stop:
            ans_print(ans)
            break

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

#文字数分aで埋める
#末尾をbにする
#一桁上の文字+1文字までは許容するルールで増加させていく

ans = [0 for _ in range(N)]
stop = [i for i in range(N)]

def ans_print(ans_list):
    ans = list()
    for a in ans_list:
        ans.append(chr(a+97)) #97でaが出る

    print(''.join(map(str, ans)))
    return 0

while 1:
    ans_print(ans)
    
    ans[-1] += 1

    for i in range(N-1,0,-1):
        if ans[i] > ans[i-1]+1:
            ans[i-1] += 1
            ans[i] = 0
            
    if ans == stop:
        ans_print(ans)
        break
Problem p02747 (python)

Fixed submission:
S = list(input())

if len(S)%2 != 0:
  print("No")
else:
  for i in range(len(S)):
    if (i%2 == 0 and S[i] != "h") or (i%2 == 1 and S[i] != "i"):
        print("No")
        break
  else:
   	print("Yes")

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

if len(S)%2 != 0:
  print("No")
else:
  for i in range(len(S)):
    if (i%2 == 0 & S[i] != "h") or (i%2 == 1 & S[i] != "i"):
        print("No")
        break
  else:
   	print("Yes")
Problem p02768 (python)

Fixed submission:
#156d
n,a,b = map(int, input().split())

##############################################
#https://tane-no-blog.com/976/
mod = pow(10, 9) + 7
 
def comb(N, x):
    #n*(n-1)*…*(n-1+1)を計算
    numerator = 1
    for i in range(N-x+1, N+1):
        numerator = numerator * i % mod
    
    #a!を計算 
    denominator = 1
    for j in range(1, x+1):
        denominator = denominator * j % mod
        
    #最後の項 a!**((10**9+7)-2)を計算
    d = pow(denominator, mod-2, mod)
    
    return numerator * d

################################

comb_all = pow(2,n,mod) - 1 #(2**n) - 1
comb_a = comb(n,a)
comb_b = comb(n,b)

#print(comb_all,comb_a,comb_b)
print((comb_all-comb_a-comb_b)%mod)

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

##############################################
#https://tane-no-blog.com/976/
mod = pow(10, 9) + 7
 
def comb(N, x):
    #n*(n-1)*…*(n-1+1)を計算
    numerator = 1
    for i in range(N-x+1, N+1):
        numerator = numerator * i % mod
    
    #a!を計算 
    denominator = 1
    for j in range(1, x+1):
        denominator = denominator * j % mod
        
    #最後の項 a!**((10**9+7)-2)を計算
    d = pow(denominator, mod-2, mod)
    
    return numerator * d

################################

comb_all = pow(2,n,MOD_BY) - 1 #(2**n) - 1
comb_a = comb(n,a)
comb_b = comb(n,b)

#print(comb_all,comb_a,comb_b)
print((comb_all-comb_a-comb_b)%MOD_BY)
Problem p02844 (python)

Fixed submission:
import bisect
N = int(input())
S = str(input())

S = list(S)
#print(S)

number_place_dict={}
for i in range(10):
  number_place_dict[i]=list()

#print(number_place_dict)

for i in range(len(S)):
  #print(int(S[i]))
  number_place_dict[int(S[i])].append(i)

#print(number_place_dict)

ans = 0

for i in range(0,1000):
  i = list(str(i))
  if len(i) == 1:
    i = [0] + [0] + i
  elif len(i) == 2:
    i = [0] + i
  elif len(i) == 0:
    i = [0] + [0] + [0]
  
  #print("i;",i)

  next_place_confition = -1

  for j in range(0,3):
    #print("数字:",int(i[j]),end="")
    place_list = number_place_dict[int(i[j])]
    index = bisect.bisect_right(place_list, next_place_confition)
    if index == len(place_list):
      #print("条件合致無し")
      break
    else:
      next_place_confition = place_list[index]
      #print("……次は→以上のindexが要:",next_place_confition)
  else:
    #print("OK")
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import bisect
N = int(input())
S = str(input())

S = list(S)

number_place_dict={}
for i in range(10):
  number_place_dict[i]=list()

#print(number_place_dict)

for i in range(len(S)):
  number_place_dict[int(S[i])].append(i)

#print(number_place_dict)

ans = 0

for i in range(0,1000):
  i = list(str(i))
  if len(i) == 1:
    i = [00]+i
  elif len(i) == 2:
    i = [0]+i
  
  #print(i)

  next_place_confition = -1

  for j in range(0,3):
    #print("数字:",int(i[j]),end="")
    place_list = number_place_dict[int(i[j])]
    index = bisect.bisect_right(place_list, next_place_confition)
    if index == len(place_list):
      #print("条件合致無し")
      break
    else:
      next_place_confition = place_list[index]
      #print("……次は→以上のindexが要:",next_place_confition)
  else:
    #print("OK")
    ans += 1

print(ans)
Problem p02888 (python)

Fixed submission:
from itertools import combinations
from bisect import bisect_left, bisect_right

N = int(input()) #2*10**3
L_list = [int(e) for e in input().split()]
index_list = [i for i in range(N)]

L_list.sort(reverse=False)
#print(L_list)

ans = 0

for comb in combinations(index_list, 2): #(2*10*3)*(2*10*3 -1)/2 ≒ 2*10*6
    a = L_list[comb[0]]
    b = L_list[comb[1]]
    
    #a < b+c ∴a-b < c
    #b < c+a ∴b-a < c
    if a-b > 0:
        low_limit = a-b
    else:
        low_limit = b-a
    index_left = bisect_right(L_list, low_limit) #log(2*10**6)≒6.3

    #c < a+b
    index_right = bisect_left(L_list, a+b) #log(2*10**6)
    
    #print(a,b,low_limit,a+b)
    #print(L_list[index_left:index_right])
    
    OK_c = index_right - index_left
    
    if index_left <= comb[0] <= index_right:
        OK_c -= 1
    if index_left <= comb[1] <= index_right:
        OK_c -= 1
        
    #print(OK_c)
    ans += OK_c
    
print(ans//3)

Buggy submission (verdict: Runtime Error):
#143d
from itertools import combinations
from bisect import bisect_left, bisect_right

N = int(input()) #2*10**3

L_list = [int(e) for e in input().split()]
index_list = [i for i in range(N)]

L_list.sort()

ans = 0

for comb in combinations(index_list, 2): #(2*10*3)*(2*10*3 -1)/2 ≒ 2*10*6
    print(comb," ",end="")
    a = L_dict[comb[0]]
    b = L_dict[comb[1]]
    
    #print("min:",b,"max:",a+b,"……",end="") #a,b a <= b   #c < a+b かつ c > b (三角形を作る為。)
    
    index_left = bisect_left(L_list, a+b) #log(2*10**6)≒6.3
    index_right = bisect_right(L_list, b) #log(2*10**6)
    
    #print(index_left,index_right)
    
    ans += index_left - index_right
    
print(ans)
Problem p02923 (python)

Fixed submission:
#abc139c
N = int(input())
list_H = list(map(int, input().split()))

ans =[]
move_count=0

if N!=1:
    for i in range(1,N,1):
        if list_H[i-1]>=list_H[i]:
            move_count+=1

            if i==N-1:
                ans.append(move_count)
        else:
            ans.append(move_count)
            move_count=0

    if len(ans)!=0:
        print(max(ans))
    else:
        print("0")
else:
    print("0")

Buggy submission (verdict: Runtime Error):
#abc139d
N = int(input())

if N>2:
    #ans=0
    #for i in range(2,N,1):
    #    ans+=i
    #print(ans+1)
    print(int((N*(N-1))/2))
    
elif N==2:
    print("1")
elif N==1:
    print("0")

#abc139c
N = int(input())
list_H = list(map(int, input().split()))

ans =[]
move_count=0

if i!=1:
    for i in range(1,N,1):
        if list_H[i-1]>=list_H[i]:
            move_count+=1

            if i==N-1:
                ans.append(move_count)
        else:
            ans.append(move_count)
            move_count=0

    if len(ans)!=0:
        print(max(ans))
    else:
        print("0")
else:
    print("0")

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

ans =[]
move_count=0

for i in range(1,N,1):
    if list_H[i-1]>=list_H[i]:
        move_count+=1
        
        if i==N-1:
            ans.append(move_count)
    else:
        ans.append(move_count)
        move_count=0
        

        
print(max(ans))
Problem p02945 (python)

Fixed submission:
A,B = list(map(int, input().split()))
print(max(A+B,A-B,A*B))

Buggy submission (verdict: Runtime Error):
A,B = list(map(int, input().split()))
print(max(A+B,A-B,A*B)
Problem p02953 (python)

Fixed submission:
#136c
N = int(input())
H_list = [int(e) for e in input().split()]

H_list[0] -= 1 #最初の奴は減らしても影響なし。

for i in range(1,N):
    #print(H_list)
    #print(H_list[i-1],H_list[i])
    
    if H_list[i-1] < H_list[i]:
        H_list[i] -= 1
    
    if H_list[i-1] > H_list[i]:
        print("No")
        break
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
#136c
N = int(input())
H_list = [int(e) for e in input().split()]

H_list[0] -= 1 #最初の奴は減らしても影響なし。

for i in range(1,N):
    print(H_list)
    print(H_list[i-1],H_list[i])
    
    if H_list[i-1] < H_list[i]:
        H_list[i] -= 1
    
    if H_list[i-1] > H_list[i]:
        print("No")
        break
else:
    print("Yes")
Problem p02993 (python)

Fixed submission:
#131a
S = str(input())
if (S[0]==S[1]) or (S[1]==S[2]) or (S[2]==S[3]):
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
#131a
S = int(input())
if (S[0]==S[1]) or (S[1]==S[2]) or (S[2]==S[3]:
    print("Bad")
else:
    print("Good")