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

Fixed submission:
import math
A, B, C, D = map(int, input().split())
if math.ceil(C/B) <= math.ceil(A/D):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
h = 'A B C D'
list = h.split(' ')

taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')

Buggy submission (verdict: Runtime Error):
h = 'A B C D'
list = h.split(' ')

taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')

Buggy submission (verdict: Runtime Error):
taka_def = int(list[0])
taka_off = int(list[1])
aoki_def = int(list[2])
aoki_off = int(list[3])

if taka_def - aoki_off <=0:
	list[0] = taka_def - aoki_off
	print('No')
else:
	list[2] = aoki_def - taka_off
	if aoki_def - taka_off <=0:
		print('Yes')
	else:
		list[0] = taka_def - aoki_off
		if taka_def - aoki_off <=0:
			print('No')
		else:
			list[2] = aoki_def - taka_off
			print('Yes')
Problem p02705 (python)

Fixed submission:
R = int(input())
h = 2*R*3.14

print(h)

Buggy submission (verdict: Runtime Error):
from math import pi

R = int(input)
h = 2*R*pi
print(h)

Buggy submission (verdict: Runtime Error):
R = int(input)
h = 2*R*3.14

print(h)

Buggy submission (verdict: Runtime Error):
R = input()
h = 2*R*3.14

print(h)

Buggy submission (verdict: Runtime Error):
h = input()
print(2h*3.14)

Buggy submission (verdict: Runtime Error):
h = 2R*3.14
Problem p02988 (python)

Fixed submission:
n=int(input())
p=list(map(int, input().split()))
i=0
for x in range(0,n-2):
    if p[x]>p[x+1] and p[x+1]>p[x+2]:
        i=i+1
    if p[x]<p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]==p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]>p[x+1] and p[x+1]==p[x+2]:
        i=i+i
print(i)

Buggy submission (verdict: Runtime Error):
n=int(input()
p=list(map(int, input().split()))
i=0
for x in range(0,n-2):
    if p[x]>p[x+1] and p[x+1]>p[x+2]:
        i=i+1
    if p[x]<p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]==p[x+1] and p[x+1]<p[x+2]:
        i=i+1
    if p[x]>p[x+1] and p[x+1]==p[x+2]:
        i=i+i
print(i)
Problem p04043 (python)

Fixed submission:
A,B,C = map(int, input().split())
if A==7 and B==5 and C==5:
  print("YES")
elif A==5 and B==5 and C==7:
  print("YES")
elif A==5 and B==7 and C==5:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C = map(int, input().split())
if A==7 and B==5 and C==5:
  print("Yes")
else if A==5 and B==5 and C==7:
  print("Yes")
else if A==5 and B==7 and C==5:
  print("Yes")
else:
  print("No")
Problem p02747 (python)

Fixed submission:
S = list(input())
flag = True

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
    if S[i] == 'h' and S[i + 1] == 'i':
      pass
    else:
      flag = not flag
      break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")

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

if len(S) % 2 == 0:
  for i in range(0, len(S), 2):
  if S[i] == 'h' and S[i + 1] == 'i':
    pass
  else:
    flag = not flag
    break
else:
  flag = not flag

if flag:
  print("Yes")
else:
  print("No")

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


for i in range(0, len(S), 2):
  if S[i] == 'h' and S[i + 1] == 'i':
    pass
  else:
    flag = not flag
    break

if flag:
  print("Yes")
else:
  print("No")
Problem p02748 (python)

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

min_cost = min(a) + min(b)

for i in range(M):
  x = list(map(int,input().split()))
  cost = a[x[0] - 1] + b[x[1] - 1] - x[2]

  if min_cost > cost:
    min_cost = cost

print(min_cost)

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

min_cost = min(a) + min(b)

for i in range(M):
  x = list(map(int,input().split()))
  cost = a[x[0]] + b[x[1]] - x[2]

  if min_cost > cost:
    min_cost = cost

print(min_cost)
Problem p02756 (python)

Fixed submission:
S = list(input())
S_r = []
Q = int(input())
R = True

for i in range(Q):
  q = list(input().split())
  if int(q[0]) == 1:
    R = not R
  else:
    if int(q[1]) == 1:
      if R:
        S_r.append(q[2])
      else:
        S.append(q[2])
    else:
      if R:
        S.append(q[2])
      else:
        S_r.append(q[2])

if not S_r:
  if R:
    print(''.join(S))
  else:
    print(''.join(S[::-1]))
else:
  if R:
    print(''.join(S_r[::-1]), end="")
    print(''.join(S))
  else:
    print(''.join(S[::-1]), end="")
    print(''.join(S_r))

Buggy submission (verdict: Runtime Error):
S = list(input())
Q = int(input())
S_r = []
S_l = []

n = 0

for i in range(Q):
  q = list(input().split())
  if int(q[0]) == 1:
    n += 1
  else:
      if int(q[1]) == 1:
        S_l.append(q[2])
        S_r = S
        n += 1
        break
      else:
        S_r.append(q[2])
        S_l = S
        n += 1
        break

  if i == Q-1:
    if not S_r and not S_l
      print(''.join(S))
    elif not S_r
      print(''.join(S_l[::-1]), end="")
      print(''.join(S))
    elif not S_l
      print(''.join(S), end="")
      print(''.join(S_r))

for i in range(Q - n):
  q = list(input().split())
  if int(q[0]) == 1:
    temp = S_r[-1]
    S_r[-1] = S_l[-1]
    S_l[-1] = temp
  else:
    if int(q[1]) == 1:
      S_l.append(q[2])
    else:
      S_r.append(q[2])

print(''.join(S_l[::-1]), end="")
print(''.join(S_r))
Problem p02687 (python)

Fixed submission:
a = input()
if a == 'ABC':
  print('ARC')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
s = input()
print(a)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b)%2 ==0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
  
if A*B%2 == 0:
    print("Even")
else:
  pritn("False")
Problem p02713 (python)

Fixed submission:
import math
a = int(input())
b = 0
for i in range(1,a+1):
    for j in range(1,a+1):
        c = math.gcd(i,j)
        for k in range(1,a+1):
            d = math.gcd(c,k)
            b +=d
print (b)

Buggy submission (verdict: Runtime Error):
from itertools import product
N = (input())
d = 0
res = [ele for ele in product(range(1,N+1),repeat=3)]
a =(res)
for i in a:
    if i[0]==i[1]==i[2]:
        d = d+i[0]
    else:
        d = d+1
print(d)

Buggy submission (verdict: Runtime Error):
import itertools
def all_passwords(chars,length):
    b = []
    c= 0
    for i in itertools.product(int(chars), repeat=length):
        a = ''.join(i)
        b.append(a)
    return b
print (all_passwords(12,2))
Problem p02715 (python)

Fixed submission:
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

from math import sqrt

def prime_division(x):
    q = int(sqrt(x))
    a = []
    for i in range(2,q+1):
        ex = 0
        while x%i == 0:
            ex += 1
            x //= i
        if ex>0:
            a.append([i,ex])
    if x>q:
        a.append([x,1])
    return a

def divisorlist(z): # z : output of prime_division
    #ddprint(f"dvl {z}")
    if len(z)==1:
        return [z[0][0]**i for i in range(z[0][1]+1)]
    y = divisorlist(z[1:])
    s = []
    for i in range(z[0][1]+1):
        for j in y:
            s.append((z[0][0]**i)*j)
    return s

n,k = inm()
d = [0]*(k+1)
d[1] = pow(k,n,R)
sm = 0
for i in range(k,1,-1):
    d[i] = (d[i]+pow(k//i,n,R))
    ps = divisorlist(prime_division(i))
    for p in ps:
        if p!=i:
            d[p] = (d[p]-d[i])%R
    sm = (sm+d[i]*i)%R
#ddprint(d)
print((sm+d[1])%R)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
dp = [[0, 0, 0] for _ in range(N+3)]

for i, x in enumerate(a, start=3):
    dp[i][2] = max(dp[i-2][0], x+dp[i-2][2], x+dp[i-3][1])
    dp[i][1] = max(x+dp[i-2][1], x+dp[i-3][0])
    dp[i][0] = x + dp[i-2][0]

if N & 1 == 0:
    print(max(
        dp[N+2][0],
        dp[N+2][1],
        dp[N+1][0]
    ))
else:
    print(max(
        dp[N+2][1],
        dp[N+2][2],
        dp[N+1][0],
        dp[N+1][1]
    ))
Problem p02743 (python)

Fixed submission:
from decimal import *
getcontext().prec = 20

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

sqrt_ab = Decimal(a).sqrt() + Decimal(b).sqrt()
sqrt_c = Decimal(c).sqrt()

if sqrt_ab < sqrt_c:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#%%
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])

#%%
from decimal import *
getcontext().prec = 20

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

sqrt_ab = Decimal(a).sqrt() + Decimal(b).sqrt()
sqrt_c = Decimal(c).sqrt()

if sqrt_ab < sqrt_c:
    print('Yes')
else:
    print('No')
Problem p02767 (python)

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

min_a = X[0]
max_a = X[-1]

sum_min = 0
sum_max = 0
    
def calc(x, min, max):
    mid = (min + max) // 2
    sum_min = 0
    sum_max = 0
    for value in x:
        sum_min += (value - min) ** 2
        sum_max += (value - max) ** 2
    
    if abs(min - max) <= 1:
        if sum_min < sum_max:
            return int(sum_min)
        else:
            return int(sum_max)
    elif sum_min < sum_max:
        return calc(x, min, mid)
    else:
        return calc(x, mid, max)
    
    return -1
    
ans = calc(X, min_a, max_a)
print(ans)

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

min_a = X[0]
max_a = X[-1]
mid = (min + max) // 2

sum_min = 0
sum_max = 0
    
def calc(x, min, max):
    mid = (min + max) // 2
    sum_min = 0
    sum_max = 0
    for value in x:
        sum_min += (value - min) ** 2
        sum_max += (value - max) ** 2
    
    if abs(min - max) <= 1:
        if sum_min < sum_max:
            return int(sum_min)
        else:
            return int(sum_max)
    elif sum_min < sum_max:
        return calc(x, min, mid)
    else:
        return calc(x, mid, max)
    
    return -1
    
ans = calc(X, min_a, max_a)
print(ans)
Problem p02741 (python)

Fixed submission:
K=int(input())
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]
print(A[K-1])

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
if (H*W)%2==0:
    B=int((H*W)/2)
    print (B)
else:
    if (H+W)%2==0:
        C=int((H*W+1)/2)
        print (C)
    else:
        D=int((H*W-1)/2)
        print(D)

Buggy submission (verdict: Runtime Error):
[H,W]=map(int,input().split())
if (H*W)%2==0:
    B=int((H*W)/2)
    print (B)
else:
    if (H+W)%2==0:
        C=int((H*W+1)/2)
        print (C)
    else:
        D=int((H*W-1)/2)
        print(D)

Buggy submission (verdict: Runtime Error):
[H,W]=map(int,input().split())
if (H*W)%2==0:
    print (int((H*W)/2))
else:
    if (H+W)%2==0:
        print (int((H*W+1)/2))
    else:
        print(int((H*W-1)/2))

Buggy submission (verdict: Runtime Error):
[H,W]=map(int,input().split())
if (H*W)%2==0:
    print (int((H*W)/2))
else:
    if (H+W)%2==0:
        print (int((H*W+1)/2))
    else:
        print(int((H*W-1)/2))
Problem p02705 (python)

Fixed submission:
a=int(input())

print(a*2*3.14)

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

print(a*π)
Problem p02687 (python)

Fixed submission:
S = input()
if(S=="ABC"):
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
S = input()
if(S="ABC"):
    print("ARC")
else:
    print("ABC")
Problem p03361 (python)

Fixed submission:
import sys

H, W = map(int, input().split())
S = [list(input()) for i in range(H)]
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(H):
    for j in range(W):
        if(S[i][j]=="."):
            continue
        exist = False
        for k in range(4):
            if(0<=i+dy[k]<H and 0<=j+dx[k]<W and S[i+dy[k]][j+dx[k]]=="#"):
                exist = True
        if(exist==False):
            print("No")
            sys.exit()     
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys

H, W = map(int, input().split())
S = [list(input()) for i in range(H)]
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(H):
    for j in range(W):
        if(S[i][j]=="."):
            continue
        exist = False
        for k in range(4):
            if(0<=i+dy[k]<H and 0<=j+dx[k]<W and S[i+dy[k]][j+dx[k]]=="#"):
                exist = True
        if(exist==False):
            print("No")
            sys.exit()     
if(exist==True):
    print("Yes")

Buggy submission (verdict: Runtime Error):
import sys

H, W = map(int, input().split())
S = [list(input()) for i in range(H)]
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]

for i in range(H):
    for j in range(W):
        if(S[i][j]=="."):
            continue
        exist = False
        for k in range(4):
            if(not 0<=i+dy[k]<H or not 0<=j+dx[k]<W):
                continue
            if(S[i+dy[k]][j+dx[k]]=="#"):
                exist = True
        if(exist==False):
            print("No")
            sys.exit()     
if(exist==True):
    print("Yes")

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = [list(input()) for i in range(H)]
dx = [-1, 0, 1, 0]
dy = [0, -1, 0, 1]


for i in range(H):
    for j in range(W):
        if(S[i][j]=="."):
            continue
        exist = False
        for k in range(4):
            if(not 0<=i+dy[k]<H or not 0<=j+dx[k]<W):
                continue
            if(S[i+dy[k]][j+dx[k]]=="#"):
                exist = True
        if(exist==False):
            print("No")
            break
            
if(exist==True):
    print("Yes")
Problem p03565 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def main(S_,T):
    for i in range(len(S_)-len(T)+1):
        for j in range(len(T)):
            if S_[i+j]!="?" and T[j]!=S_[i+j]:break
        else:
            print(''.join(list(reversed((S_[:i]+T+S_[i+j+1:]).replace("?","a")))))
            exit()
    print("UNRESTORABLE")

if __name__ == '__main__':
    S_ = "".join(list(reversed(input())))
    T = "".join(list(reversed(input())))
    main(S_,T)

Buggy submission (verdict: Runtime Error):
def main(S_,T):

    for i in range(len(S_)-len(T)+1):
        cnt = 0
        idx = -1
        for j in range(len(T)):
            if(S_[i+j]==T[j] or S_[i+j]=="?"):
                cnt += 1
                if cnt == len(T):
                    idx = i+j-len(T)+1
                else:
                    continue
            else:
                break
                
    if idx == -1:
        print("UNRESTORABLE")
    else:
        for i in range(len(T)):
            S_[idx+i] = T[i]
        for i in range(len(S_)):
            if S_[i] == "?":
                S_[i] = "a"
        print("".join(S_))

if __name__ == '__main__':
    S_ = list(input())
    T = list(input())
    main(S_,T)
Problem p03633 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def gcd(a,b):
    if(b==0):
        return a
    return gcd(b, a%b)

def lcm(a,b):
    return (a * b)//gcd(a, b)

def main(N,T):
    ans = 1
    for t in T:
        ans = lcm(ans, t)
        
    print(ans)

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    main(N,T)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

def lcm(a,b):
    return (a * b) // math.gcd(a, b)

def main(N,T):
    ans = 1
    for t in T:
        ans = lcm(ans, t)
        
    print(ans)

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))
    main(N,T)
Problem p03659 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def main(N,A):
    zenbu = sum(A)
    part_sum = [A[0]]
    ans = float("INF")
    for i in range(1,N): 
        ans = min(ans, abs(zenbu-2*part_sum[-1]))
        part_sum.append(part_sum[-1]+A[i])

    print(ans)
    
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    main(N,A)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def main(N,A):
    zenbu = sum(A)
    part_sum = [A[0]]
    ans = float("INF")
    for i in range(1,N): 
        print(part_sum,zenbu-part_sum[-1])
        ans = min(ans, abs(zenbu-2*part_sum[-1]))
        part_sum.append(part_sum[-1]+A[i])

    print(ans)
    
if __name__ == '__main__':
    N = int(input())
    A = [int(a) for a in input().split()]
    main(N,A)
Problem p03853 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def solve(H, W, C):
    for i in range(H):
        for j in list(C[i]):
            print(j)
            print(j)
        
if __name__ == '__main__':
    H, W = map(int, input().split())
    C = [[input()] for i in range(H)]
  
    solve(H, W, C)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def solve(H, W, C):
    for i in range(2*H):
        for j in C[i]:
            print(j)
            print(j)
        

if __name__ == '__main__':
    H, W = map(int, input().split())
    C = [[input()] for i in range(H)]
  
    solve(H, W, C)
Problem p03997 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def solve(a, b, h):
    print(int((a+b)*h/2))

if __name__ == '__main__':
    a  = int(input())
    b = int(input())
    h = int(input())

    solve(a, b, h)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def solve(a, b, h):
    print(int((a+b)*h/2)

if __name__ == '__main__':
    a  = int(input())
    b = int(input())
    h = int(input())

    solve(a, b, h)
Problem p04030 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def solve(S):
    A = []
    for i in range(len(S)):
        if(S[i]=="0" or S[i]=="1"):
            A.append(S[i])
        elif(len(A)>0 and S[i]=="B"):
            A.pop()
    print("".join(A))
    
if __name__ == '__main__':
    S = input()
    
    solve(S)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np

def solve(S):
    A = []
    for i in range(len(S)):
        if(S[i]=="0" or S[i]=="1"):
            A.append(S[i])
        else:
            A.pop()
    print("".join(A))
    
if __name__ == '__main__':
    S = input()
    
    solve(S)
Problem p02690 (python)

Fixed submission:
x = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

ans = None
d_ls = make_divisors(x)
for d in d_ls:
    for a in range(0, 1000):
        b = a-d
        c = a**5-b**5
        if c==x:
          ans = (a, b)
          break
    if ans is not None:
      break
print(ans[0], ans[1])

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

ans = None
d_ls = make_divisors(x)
for d in d_ls:
    for a in range(0, 100):
        b = a-d
        c = a**5-b**5
        if c==x:
          ans = (a, b)
          break
    if ans is not None:
      break
print(ans[0], ans[1])

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

ans = None
d_ls = make_divisors(x)
for d in d_ls:
    for a in range(2, 100):
        b = 2-d
        c = a**5-b**5
        if c==x:
          ans = (a, b)
          break
    if ans is not None:
      break
print(ans[0], ans[1])
Problem p02796 (python)

Fixed submission:
n = int(input())
xl = [[int(i) for i in input().split(' ')] for j in range(n)]

ls = sorted([[i-j, i+j] for i, j in xl], key=lambda x: x[1])

i, dr = 0, 0
while True:
    if (len(ls)<=1) | (i+1 >= len(ls)):
        break
    a, b = ls[i], ls[i+1]
    if a[1]>b[0]:
        dr += 1
        ls.pop(i+1)
    else:
        i += 1

print(len(ls))

Buggy submission (verdict: Runtime Error):
n = int(input())
xl = [[int(i) for i in input().split(' ')] for j in range(n)]

ls = sorted([[i-j, i+j] for i, j in xl], key=lambda x: x[1])
i, dr = 0, 0
while True:
    if len(ls)<=1:
        break
    a, b = ls[i], ls[i+1]
    if a[1]>b[0]:
        dr += 1
        ls.pop(i+1)
    else:
        i += 1
        if i+1 >= len(ls):
            break
print(len(ls))

Buggy submission (verdict: Runtime Error):
n = int(input())
xl = [[int(i) for i in input().split(' ')] for j in range(n)]
import numpy as np

ls = np.array([[i-j, i+j] for i, j in xl])
ls = ls[ls[:, 0].argsort()]
 
i, dr = 0, 0
while True:
    a, b = ls[i], ls[i+1]
    if a[1]>b[0]:
        dr += 1
        ls = np.delete(ls, i+1, 0)
    else:
        i += 1
        if i+1 >= len(ls):
            break
print(len(ls))
Problem p02953 (python)

Fixed submission:
import numpy as np

n = int(input())
h = np.array([int(i) for i in input().split()])

err = 0
f = 0
for i in range(n-1):
  t = h[i+1] - h[i]
  if t>=-1 and f>=-1 and not(t==-1 and f==-1):
    pass
  else:
    err = 1
    break
    
  if t!=0:
    f = t
  
if err==1:
  print('No')
else:
  print('Yes')

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

n = int(input())
h = np.array([int(i) for i in input().split()])

d = np.diff(h)
dd = np.array([d[i]+d[i+1] for i in range(len(d)-1)])

if n == 1:
  print('Yes')
elif (d>=-1) and (dd>=-1).all():
  print('Yes')
else:
  print('No')