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

Fixed submission:
def f(s, i, d):
  if len(d) == 0:
    return "-1"
  if len(s) == i:
    d.sort()
    return d[0]
  d.remove(s[i])
  r = f(s, i+1, d)
  if r == "-1":
    d.sort()
    for j in d:
      if s[i] < j:
        return j
    d.append(s[i])
    return "-1"
  return "".join([s[i], r])

def main():
  d = list("abcdefghijklmnopqrstuvwxyz")
  t = input()
  r = f(t, 0, d)
  print(r)

main()

Buggy submission (verdict: Runtime Error):
def f(s, i, d):
  if len(s) == i:
    d.sort()
    return d[0]
  if len(d) == 0:
    return "_"
  d.remove(s[i])
  r = f(s, i+1, d)
  if r == "_":
    d.sort()
    for i in d:
      if s[i] < i:
        return i
    d.append(s[i])
    return "_"
  return "".join([s[i], r])

def main():
  d = list("abcdefghijklmnopqrstuvwxyz")
  t = input()
  r = f(t, 0, d)
  print(r)
  
main()

Buggy submission (verdict: Runtime Error):
def f(s, i, d):
  if len(s) == i:
    d.sort()
    return d[0]
  if len(d) == 0:
    return "_"
  d.remove(s[i])
  r = f(s, i+1, d)
  if r == "_":
    d.sort()
    for i in d:
      if s[i] < i:
        return i
    d.append(s[i])
    return "_"
  return "".join(s[i], r)

def main():
  d = list("abcdefghijklmnopqrstuvwxyz")
  t = input()
  r = f(t, 0, d)
  print(r)
  
main()
Problem p04029 (python)

Fixed submission:
N=int(input())
print(int(N * (N+1) /2))

Buggy submission (verdict: Runtime Error):
print(int((N=int(input())) * (N+1) /2))

Buggy submission (verdict: Runtime Error):
print((N=int(input()) * (N+1) /2)
Problem p04033 (python)

Fixed submission:
def main():
  t = input().split(" ")
  A = int(t[0])
  B = int(t[1])
  
  if B < 0:
    if (B - A) % 2 == 1:
    	print("Positive")
    else :
    	print("Negative")
  elif 0 < A:
    print("Positive")
  else:
    print("Zero")
    
main()

Buggy submission (verdict: Runtime Error):
def main():
  t = input().split(" ")
  A = int(t[0])
  B = int(t[1])
  
  if B < 0:
    if (B - A) % 2 == 1
    	print("Positive")
    else :
    	print("Negative")
  elif 0 < A:
    print("Positive")
  else:
    print("Zero")
    
main()

Buggy submission (verdict: Runtime Error):
def main():
  t = input().split(" ")
  A = int(t[0])
  B = int(t[1])
  
  if b < 0:
    print("Negative")
  elif 0 < a:
    print("Positive")
  else:
    print("Zero")
    
main()
Problem p02724 (python)

Fixed submission:
num = int(input())
re = 0
while num >= 500:
    re+=1000
    num-=500
while num >=5:
    re+=5
    num-=5
print(re)

Buggy submission (verdict: Runtime Error):
num = int(input())
point = 0
while num >= 500:
    point+=1000
    num-=500
while num >=5:
    point+=5
    num-=5
print(re)
Problem p02772 (python)

Fixed submission:
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        int[] myArray = new int[N];
        for(int i=0;i<N;i++)
        {
            myArray[i] = input.nextInt();
        }
        for(int i : myArray)
        {
            if(i%3==0||i%5==0)
                System.out.println("APPROVED");
            else
                System.out.println("DENIED");
        }

    }
}
Problem p02783 (python)

Fixed submission:
import math

H, A = [int(x) for x in input().split()]
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
import math

A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
print(math.ceil(H/A))

Buggy submission (verdict: Runtime Error):
import math
A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
print(math.ceil(H))
Problem p02784 (python)

Fixed submission:
H, N = [int(x) for x in input().split()]
attacks = [int(x) for x in input().split()]
print("Yes" if H - sum(attacks) <= 0 else "No")

Buggy submission (verdict: Runtime Error):
N = [int(x) for x in input().split()]
attacks = [int(x) for x in input().split()]
print("Yes" if H - sum(attacks) <= 0 else "No")
Problem p02812 (python)

Fixed submission:
N = input()
S = input()
print(S.count("ABC"))

Buggy submission (verdict: Runtime Error):
int N = input()
int S = input()
print(S.count("ABC"))

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

res = count("ABC")
print(res)
Problem p03729 (python)

Fixed submission:
a, b, c = input().split()
if a[len(a)-1]==b[0] and b[len(b)-1]==c[0]:
    print("YES")
else:
    print("NO")

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

flg = 0

for i in range(100000):
    if (i*a)%b = c:
        flg+=1
    break

if flg==0:
    print("NO")
else:
    print("YES")
Problem p03730 (python)

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

flg = 0

for i in range(100000):
    if (i*a)%b == c:
        flg+=1
        break

if flg==0:
    print("NO")
else:
    print("YES")

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

flg = 0

for i in range(100000000):
    if (i*a)%b = c:
        flg+=1
    break

if flg==0:
    print("NO")
else:
    print("YES")
Problem p03826 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if a*b==c*d:
    print(a*b)
else:
    print(max(a*b, c*d))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
x=0
ans=0
for i in range(n):
    if s[i]=="I":
        x += 1
    else:
        x -= 1
    ans = max(ans,x)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
x=0
max=0
for i in range(n):
    if s[i]=="I":
        x += 1
    else:
        x -= 1
    max = max(max,x)
print(max)
Problem p02765 (python)

Fixed submission:
N,R= map(int,input().split())
if N < 10:
    print(R+100*(10-N))
else:
    print(R)

Buggy submission (verdict: Runtime Error):
N = int(input())
R = int(input())
if N < 10:
    print(R+100*(10-N))
else:
    print(R)

Buggy submission (verdict: Runtime Error):
N = int(input())
R = int(input())
if N < 10:
    print(1000-100*N)
else:
    print(R)
Problem p02982 (python)

Fixed submission:
import math
import itertools


N, D = (int(i) for i in input().split())
X = [0]*N


for n in range(N):
    l = input().split()
    X[n] = [0]*D
    for d in range(D):
        X[n][d] = int(l[d])


count = 0
for y, z in itertools.combinations(X, 2):
    d = math.sqrt(sum(pow(y[i] - z[i], 2) for i in range(D)))
    if d.is_integer():
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math
import itertools


N, D = (int(i) for i in input().split())
X = [0]*N


for n in range(N):
    l = input().split()
    X[n]=[0]*D
    for d in range(D):
        X[n][d] = int(l[d])


count = 0
for y, z in itertools.combinations(X, 2):
    print(f"y={y}, z={z}")
    d = math.sqrt(sum(pow(y[i] - z[i], 2) for i in range(D)))
    if d.is_integer():
        count += 1

print(count)
Problem p03389 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False
if debug_mode:
    import os
    infile = open(os.path.basename(__file__).replace(".py", ".in"))

    def input():
        return infile.readline()


# ==============================================================


def main():
    a, b, c = list(map(int, input().strip().split()))
    s = sum((a, b, c))
    x = max(a, b, c)
    steps = 0
    while True:
        if s + steps * 2 == 3 * x:
            break
        elif s + steps * 2 < 3 * x:
            steps += 1
        elif s + steps * 2 > 3 * x:
            x += 1
    print(steps)


main()

# ==============================================================

if debug_mode:
    infile.close()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)

debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False
if debug_mode:
    import os
    infile = open(os.path.basename(__file__).replace(".py", ".in"))

    def input():
        return infile.readline()


# ==============================================================


def main():
    a, b, c = list(map(int, input().strip().split()))
    s = sum(a, b, c)
    x = min(a, b, c)
    steps = 0
    while True:
        if s + steps * 2 == 3 * x:
            break
        elif s + steps * 2 < 3 * x:
            steps += 1
        elif s + steps * 2 > 3 * x:
            x += 1
    print(steps)


main()

# ==============================================================

if debug_mode:
    infile.close()
Problem p04043 (python)

Fixed submission:
import sys

debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False
if debug_mode:
    import os
    inf = open(os.path.basename(__file__).replace(".py", ".in"))

    def input():
        return inf.readline()
else:
    inf = sys.stdin

# ==============================================================

def solve():
    abc = input()
    if abc.count("7") == 1 and abc.count("5") == 2:
        print("YES")
    else:
        print("NO")


solve()

# ==============================================================

if debug_mode:
    inf.close()

Buggy submission (verdict: Runtime Error):
import sys

debug_mode = True if len(sys.argv) > 1 and sys.argv[1] == "-d" else False
if debug_mode:
    import os
    inf = open(os.path.basename(__file__).replace(".py", ".in"))

    def input():
        return inf.readline()
else:
    inf = sys.stdin

# ==============================================================

def main():
    n, k = [int(x) for x in input().strip().split()]
    d = [x for x in input().strip().split()]

    while True:
        str_n = str(n)
        if any(i in str_n for i in d):
            n += 1
        else:
            break
    
    print(n)


main()

# ==============================================================

if debug_mode:
    inf.close()
Problem p02743 (python)

Fixed submission:
import math

from decimal import Decimal

A,B,C = map(int,input().split())

a = Decimal(A).sqrt()
b = Decimal(B).sqrt()
c = Decimal(C).sqrt()


#if math.sqrt(A)+math.sqrt(B)<math.sqrt(C):
if a+b<c:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A,B,C = map(float,input().split())


if math.sqrt(A)+math.sqrt(B)<math.sqrt(C):
    print("YES")
else:
    print("NO")
Problem p02787 (python)

Fixed submission:

     

import math



H,N = map(int,input().split())
Damage = []
Cost = []


DP = [0] + [pow(10,9)] * (H+1)



for i in range(N):
    a,b = map(int,input().split())
    Damage.append(a)
    Cost.append(b)
    
#print(DP)


# DP[i] = min magic points to do i damage

for i in range(1,len(DP)):
    for spell in range(N):
        DP[i] = min(DP[i],DP[max(0,i-Damage[spell])]+Cost[spell])




print (DP[H])

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
Damage = []
Cost = []


DP = [0] + [pow(10,9)] * (H+1)



for i in range(N):
    a,b = map(int,input().split())
    Damage.append(a)
    Cost.append(b)
    
#print(DP)

damage = np.array(Damage)
cost = np.array(Cost)
dp = np.array(DP)




# DP[i] = best magic points to do i damage

for i in range(1,len(dp)):
    for spell in range(N):
        dp[i] = min(dp[i],dp[max(0,i-damage[spell])]+cost[spell])




print (dp[H])
Problem p02802 (python)

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


correct = [0] * (n+1)
wrong = [0] * (n+1)



for _ in range(m):
    problem,result_text = input().split()
    problem = int(problem)
    
    if result_text == "AC":
        correct[problem]=1
        
    
    if result_text == "WA":
        if correct[problem] == 0:
            wrong[problem] += 1
    

for problem in range(n+1):
    if correct[problem] == 0:
        wrong[problem] = 0



print ( sum(correct), sum(wrong) )

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


correct = [0] * (n+1)
wrong = [0] * (n+1)



for _ in range(m):
    problem,result_text = input().split()
    problem = int(problem)
    
    if result_text == "AC":
        correct[problem]=1
        
    
    if result_text == "WA":
        if correct[problem] == 0:
            wrong[problem] += 1
    

for _ in range(len(wrong)):
    if correct[problem] == 0:
        wrong[problem] = 0



print ( sum(correct), sum(wrong) )
Problem p02811 (python)

Fixed submission:
k,x = input().split(" ")
k = int(k)
x = int(x)



text = "No"
 
if k*500>=x:
  text = "Yes"
  
print(text +"\n")

Buggy submission (verdict: Runtime Error):
k,x = input()

text = "No"

if k*500>=x:
  text = "Yes"
  
print(text)
Problem p03160 (python)

Fixed submission:
import math

N = int(input())
data = list(map(int,input().split()))


BIG = pow(10,9)+7

dp = [BIG]*(N+1)

dp[0] = 0

for i in range(N):
    for j in range(i+1,i+3):
        if j<N:
            dp[j] = min(dp[j], dp[i] + abs(data[i]-data[j]))
            
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a
f_inf = pow(10,9)+99

dp = [f_inf] * (n+1)
dp[0] = 0
for i in range(1, n):
    for j in range(1, k+1):
        if i - j >= 0:
            dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
data = list(map(int(input().split()))
            
print ("11"+"\n")

Buggy submission (verdict: Runtime Error):
N = input()
data = list(map(int(input().split()))
            
print (11)

Buggy submission (verdict: Runtime Error):
N = input()
data = list(map(int(input().split()))
            
print ("11")
Problem p03161 (python)

Fixed submission:
n, k = map(int, input().split())
h = [int(i) for i in input().split()]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a
f_inf = pow(10,9)+99

dp = [f_inf] * (10**5+10)
dp[0] = 0
for i in range(1, n):
    for j in range(1, k+1):
        if i - j >= 0:
            dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = [int(i) for i in input().split()]

def chmin(a, b):
    if a > b:
        return b
    else:
        return a
f_inf = pow(10,9)+99

dp = [f_inf] * (N+1)
dp[0] = 0
for i in range(1, n):
    for j in range(1, k+1):
        if i - j >= 0:
            dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
    i, k = map(int, input().split())
    h = [int(i) for i in input().split()]
    # dpの最小値を変更する関数
    def chmin(a, b):
        if a > b:
            return b
        else:
            return a
    # 無限大の値
    f_inf = pow(10,9)+99
    # DP テーブルを初期化　(最小化問題なので INF に初期化)
    dp = [f_inf] * (10**5+10)
    # 初期条件
    dp[0] = 0
    for i in range(1, n):
        for j in range(1, k+1):
            if i - j >= 0:
                dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
    print(dp[n-1])

Buggy submission (verdict: Runtime Error):
    in, k = map(int, input().split())
    h = [int(i) for i in input().split()]
    # dpの最小値を変更する関数
    def chmin(a, b):
        if a > b:
            return b
        else:
            return a
    # 無限大の値
    f_inf = pow(10,9)+11
    # DP テーブルを初期化　(最小化問題なので INF に初期化)
    dp = [f_inf] * (10**5+10)
    # 初期条件
    dp[0] = 0
    for i in range(1, n):
        for j in range(1, k+1):
            if i - j >= 0:
                dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
    print(dp[n-1])

Buggy submission (verdict: Runtime Error):
    in, k = map(int, input().split())
    h = [int(i) for i in input().split()]
    # dpの最小値を変更する関数
    def chmin(a, b):
        if a > b:
            return b
        else:
            return a
    # 無限大の値
    f_inf = float('inf')
    # DP テーブルを初期化　(最小化問題なので INF に初期化)
    dp = [f_inf] * (10**5+10)
    # 初期条件
    dp[0] = 0
    for i in range(1, n):
        for j in range(1, k+1):
            if i - j >= 0:
                dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
    print(dp[n-1])

Buggy submission (verdict: Runtime Error):
    in, k = map(int, input().split())
    h = [int(i) for i in input().split()]
    # dpの最小値を変更する関数
    def chmin(a, b):
        if a > b:
            return b
        else:
            return a
    # 無限大の値
    f_inf = float('inf')
    # DP テーブルを初期化　(最小化問題なので INF に初期化)
    dp = [f_inf] * (10**5+10)
    # 初期条件
    dp[0] = 0
    for i in range(1, n):
        for j in range(1, k+1):
            if i - j >= 0:
                dp[i] = chmin(dp[i], dp[i-j]+ abs(h[i] - h[i - j]))
    print(dp[n-1])
Problem p03035 (python)

Fixed submission:
A, B = map(int,input().split())
if A < 6:
  print(0)
elif A > 12:
  print(B)
else:
  print(int(B/2))

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())
if A < 6:
  print(0)
elif A > 12:
  print(B)
else:
  print(int(B/2)
Problem p02741 (python)

Fixed submission:
a=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[K-1])

Buggy submission (verdict: Runtime Error):
h,w=map(int,(input().split()))
r=0
for i in range(h):
    if i % 2 == 0:
        r+=(w+1)//2
    else:
        r+= w//2
print(r)
Problem p03105 (python)

Fixed submission:
a,b,c= map(int, input().split())
d=int(b/a)
if d>= c:
  print(c)
else:
  print(d)

Buggy submission (verdict: Runtime Error):
a,b,c= map(int, input().split())
d=(b/a)
if d=> c:
  print(c)
else:
  print(d)

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

if (b/a) => c:
  print(c)
else:
  print(b/a)
Problem p03106 (python)

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
		  a, b = b, a % b
    return a

a,b,c= map(int, input().split())
d= int(gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy submission (verdict: Runtime Error):
import fraction

a,b,c= map(int, input().split())
d= int(fraction.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy submission (verdict: Runtime Error):
import fraction

a,b,c= map(int, input().split())
d= int(math.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])

Buggy submission (verdict: Runtime Error):
import math

a,b,c= map(int, input().split())
d= int(math.gcd(a,b))
if c==1:
  print(d)
else:
  arr=[]
  for i in range(1,d):
    if(d%i == 0):
      arr.append(i)
  print(arr[-(c-1)])
Problem p03160 (python)

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

dp=[0]*(N+1)

dp[0]= 0
dp[1]= abs(h[1]-h[0])

for i in range(2, N):
    # print((dp[i-1]+ abs(h[i]-h[i-1])))
    # print((dp[i-2]+ abs(h[i]-h[i-2])))
    # print()
    dp[i]= min( (dp[i-1]+ abs(h[i]-h[i-1])) , (dp[i-2]+ abs(h[i]-h[i-2])))
    # print(dp[i])

# print(dp)
print(dp[N-1])

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

dp=[N+1]

dp[0]= 0
dp[1]= h[0]

for i in range(1, N+1):
    dp[i]= min( (dp[n-1]+ abs(h[n]-h[n-1]) , dp[n-2]+ abs(h[n]-h[n-2])))

print(dp[N])

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

dp=[N+1]

dp[0]= 0
dp[1]= h[0]

for i in range(1, N+1):
    dp[i]= min( (dp[n-1]+ abs(h[n]-h[n-1]) , dp[n-2]+ abs(h[n]-h[n-2]))

print(dp[N])
Problem p02765 (python)

Fixed submission:
N,R = map(int,input().split())
if N >= 10:
  print(R)
else:
  print(R+100*(10-N))

Buggy submission (verdict: Runtime Error):
N = int(input())
R = int(input())
if N > 1 & N <100 & R > 0 & R < 4111 :
  if N >= 10 :
    print(R)

  else :
    print(R-100*(10-N))
else:
  print('error')
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
# print(listl)

cnt=1
d=0
# print(d)
for i in range(len(l)):
    d = d+l[i]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=1
d=0
# print(d)
for i in range(n):
    d = d+listl[cnt]
    if d > x:
        break
    # print(d)
    cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
listl = []
listl += map(int,input().split())
# print(listl)

cnt=0
d=0
# print(d)
while d <= x:
    d = d+listl[cnt]
    # print(d)
    cnt+=1

print(cnt)
Problem p03323 (python)

Fixed submission:
S = input()
A,B = S.split()

A = int(A)
B = int(B)

if A<=8 and B <=8:
    print("Yay!")
elif A>8 or B>8:
    print(":(")

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

if A<=8 and B <=8:
    print("Yay!")
elif A>8 or B>8:
    print(":(")
Problem p02953 (python)

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

min = 0
for i in b:
    if min == i:
        continue
    if min > i:
        print("No")
        exit()
    if min < i :
        min = i-1



print("Yes")

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


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[len(a-1)] < b[len(a-2)]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")

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


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[len(a-1)] < b[len(a-2]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")

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


for i in range(a-1):
    if b[i] - b[i+1] >0:
        b[i] = b[i]-1

for i in range(a-1):
    if b[i] - b[i+1] >0:
        answe= False

if b[i] > b[i+1]:
    answe= False

if answe == True:
    print("Yes")
else:
    print("No")
Problem p03035 (python)

Fixed submission:
a,b = map(int,input().split())
 
ans = b
if a <= 5:
  ans = 0
elif a <= 12:
  ans = int(b/2)
 
print(ans)

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

ans = b
if a <= 5:
  ans = 0
elif a <= 12:
  ans = b/s

print(ans)
Problem p03067 (python)

Fixed submission:
a,b,c = map(int,input().split())
 
if c == min(a,b,c):
 print('No')
elif c == max(a,b,c):
 print('No')
else:
 print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
c = 0
b = s[:n-1].count('#')
w = s[1:].count('.')
for i in range(n-1):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b,w))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
c = 0
b = s[:n-1].count('#')
w = s[:n-1].count('.')
for i in range(n-1):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b,w))
Problem p03069 (python)

Fixed submission:
n = int(input())
s = input()
ans = s.count('.')
num = ans
for c in s:
  if c == '.':
    num -= 1
  else:
    num += 1
  
  ans = min(ans,num)

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
c = 0
b = s.count('#')
for i in range(n):
 if s[i] == '#' and s[i + 1] == '.':
  c += 1
  s[i +1] = '#'

print(min(c,b))