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

Fixed submission:
s = str(input())
t = s[::-1]
if(s != t):
    print("No")
    exit()
c = ""
for i in range((len(s)-1)//2):
    c += s[i]
e = c[::-1]
if(e != c):
    print("No")
    exit()
r = ""
for i in range(((len(s)+3)//2)-1,len(s),1):
    r += s[i]
y = r[::-1]
if(r != y):
    print("No")
    exit()
print("Yes")
"""
print(s,t)
print(e,c)
print(r,y)
"""

Buggy submission (verdict: Runtime Error):
s = str(input())
t = s[::-1]
if(s != t):
    print("No")
    exit
c = ""
for i in range((len(s)-1)//2):
    c += s[i]
e = c[::-1]
if(e != c):
    print("No")
    exit()
r = ""
for i in range(((len(s)+3)//2)-1,len(s),1):
    r += s[i]
y = r[::-1]
if(r != y):
    print("No")
    exit()
"""
print("Yes")
print(s,t)
print(e,c)
print(r,y)
Problem p02842 (python)

Fixed submission:
n = int(input())
for i in range(1,n+1):
  if(int(i*1.08) == n):
    print(i)
    exit()
print(":(")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
	if(int(i * 1.08) == n):
      print(i)
      exit()
print(":(")
Problem p02848 (python)

Fixed submission:
n = int(input())
s = str(input())
for i in range(len(s)):
    r = ord(s[i])+n
    if 90 < r:
        print(chr(r-26),end="")
    else:
        print(chr(r),end="")
print()

Buggy submission (verdict: Runtime Error):
n = int(input())
s = str(input())
for i in range(n):
    if s[i] == "Z":
        print("A",end="")
    else:
        print(chr(ord(s[i])+1),end="")
print()
Problem p02887 (python)

Fixed submission:
x = int(input())
slime = str(input())
i = 0
scount = 1
while(i < x-1):
    if(slime[i] != slime[i+1]):
        scount += 1
    i += 1
print(scount)

Buggy submission (verdict: Runtime Error):
x = int(input())
slime = str(input())
i = 0
scount = 0
while(i < n-1):
    if(slime[i] != slime[i+1]):
        scount += 1
    i += 1
print(scount)
Problem p02888 (python)

Fixed submission:
import bisect
n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        r = bisect.bisect_left(l,l[i]+l[j])
        ans += r-(j+1)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
a = list(map(int,input().split()))
s = itertools.permutations(n,3)
count = 0
for i in range(len(s)):
  r = [a[s[0]],a[s[1]],a[s[2]]]
  if (sum(r) - max(r)) >= max(r):
    count += 1
print(count)
Problem p02923 (python)

Fixed submission:
n = int(input())
count = -1
ans = []
a = list(map(int,input().split()))
for i in range(n-1):
    if(a[i] >= a[i+1]):
        count += 1
        ans.append(count+1)
    else:
        count = -1
        ans.append(count+1)
if(len(a) == 1):
    print(0)
else:
    print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
count = -1
ans = []
a = list(map(int,input().split()))
for i in range(n-1):
    if(a[i] >= a[i+1]):
        count += 1
        ans.append(count+1)
    else:
        count = -1
        ans.append(count+1)
print(max(ans))
Problem p03076 (python)

Fixed submission:
a = []
for i in range(5):
    a.append(int(input()))
b = []
for i in a:
    if i%10:
        b.append(i)
c = min(b,key = lambda x:x%10) if len(b) else 0
ans = 0
for i in a:
    if i%10:
        ans += i+(10-i%10)
    else:
        ans += i
print(ans-(10-c%10) if len(b) else ans)

Buggy submission (verdict: Runtime Error):
a = []
for i in range(5):
    a.append(int(input()))
b = []
for i in a:
    if i%10:
        b.append(i)
c = min(b,key = lambda x:x%10)
ans = 0
for i in a:
    if i%10:
        ans += i+(10-i%10)
    else:
        ans += i
print(ans-(10-c%10))
Problem p03102 (python)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
ans = 0
for i in range(n):
    a = list(map(int,input().split()))
    ans += 1 if 0 < c+sum([a[j]*b[j] for j in range(m)]) else 0
print(ans)

Buggy submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
ans = 0
for i in range(m):
    current = 0
    a = list(map(int,input().split()))
    for k,j in enumerate(a):
        current += j*(k+1)
    ans += 1 if c+current else 0
print(ans)
Problem p03103 (python)

Fixed submission:
n,m = map(int,input().split())
a = []
for i in range(n):
    a.append(list(map(int,input().split())))
a.sort(key = lambda a:a[0])
bought = 0
price = 0
for i in range(n):
    remain = m - bought
    if a[i][1] < remain:
        bought += a[i][1]
        price += a[i][0] * a[i][1]
    else:
        price += a[i][0]*remain
        print(price)
        exit()

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a,b = [0 for _ in range(n)],[0 for _ in range(n)]

for i in range(n):
    a[i],b[i] = map(int,input().split())

bought = 0
ans = 0
while(bought <= m):
    remain = m - bought
    if b[a.index(min(a))] <= remain:
        ans += min(a)*b[a.index(min(a))]
        bought += b[a.index(min(a))]
        b.remove(b[a.index(min(a))])
        a.remove(min(a))
    else:
        ans += min(a)*remain
        break
print(ans)
Problem p03425 (python)

Fixed submission:
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
    s[i] = s[i][0]

march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]

for i in range(len(s)):
    if s[i] in march:
        march_num[march.index(s[i])] += 1
ans = 0
for i in range(3):
    for j in range(i+1,4):
        for k in range(j+1,5):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
    s[i] = s[i][0]

march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]

for i in range(n):
    if s[i] in march:
        march_num[march.index(s[i])] += 1
ans = 0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = ["" for _ in range(n)]
for i in range(n):
    s[i] = str(input())
march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]
for i in range(n):
    if s[i][0] in march:
        march_num[march.index(s[i][0])] += 1
ans = 0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s.append(str(input()))
march = ["M","A","R","C","H"]
march_num = [0,0,0,0,0]
for i in range(n):
    if s[i][0] in march:
        march_num[march.index(s[i][0])] += 1
ans = 0
for i in range(len(s)-2):
    for j in range(i+1,len(s)-1):
        for k in range(j+1,len(s)):
            ans += (march_num[i]*march_num[j]*march_num[k])
print(ans)
Problem p03607 (python)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
a.sort()
d = [1]
for i in range(n-1):
    if a[i] != a[i+1]:
        d.append(1)
    else:
        d[-1] += 1
ans = 0
for i in d:
    ans += i%2
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())

t = max(a)
b = [0]*(t+1)

for i in range(n):
    if(b[a[i]] == 0):
        b[a[i]] = 1
    else:
        b[a[i]] = 0

print(sum(b))
Problem p03659 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = [0]
if (n == 2):
    print(abs(a[0] - a[1]))
else:
    for i in range(n):
        s.append(a[i] + s[i])

    b = 1e+9
    j = 1
    
    while(j < n):
        if (abs(s[j] - (s[n] - s[j])) < b):
            b = abs(s[j] - (s[n] - s[j]))
        j += 1
    print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
s = [0]
if (n == 2):
    printf(abs(a[0] - a[1]))
else:
    for i in range(n):
        s.append(a[i] + s[i])

    b = 1e+9

    for j in range(n+1):
        if (abs(s[j] - (s[n] - s[j])) < b):
            b = abs(s[j] - (s[n] - s[j]))
    print(b)
Problem p03760 (python)

Fixed submission:
O = str(input())
E = str(input())
ans = []
for i in range(len(E)):
    ans.append(O[i])
    ans.append(E[i])
if(len(O) != len(E)):
    ans.append(O[-1])
print("".join(ans))

Buggy submission (verdict: Runtime Error):
o = str(input())
e = str(input())
ans = []
for i in range(len(o)):
    ans.append(o[i])
    ans.append(e[i])
print(ans)

Buggy submission (verdict: Runtime Error):
o = str(input())
e = str(input())
ans = []
for i in range(len(o)):
    ans.append(o[i])
    ans.append(e[i])
print("".join(ans))
Problem p02646 (python)

Fixed submission:
a,c=map(int,input().split())
b,d=map(int,input().split())
t=int(input())
if c<=d:
  print('NO')
else:
  if abs(a-b)<=(c-d)*t:
  	print('YES')
  else:
    print('NO')

Buggy submission (verdict: Runtime Error):
a,c=map(int,input().split())
b,d=map(int,input().split())
t=map(int,input().split())
if c<=d:
  print('NO')
elif abs(a-b)<=(c-d)*t:
  print('YES')
else:
  print('NO')
Problem p02576 (python)

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

for i in range(1001):
    if i * X >= N:
        print (i * T)
        break

Buggy submission (verdict: Runtime Error):
N, X, T = map(int, raw_input().split())

for i in range(1001):
    if i * X >= N:
        print (i * T)
        break
Problem p02582 (python)

Fixed submission:
S = input()

a = "RRR"
b = "RR"
c = "R"
    
if a == S:
    print(3)
    
elif b in S:
    print(2)

elif c in S:
    print(1)
    
else:
    print(0)

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

a=RSS
b=RRS
c=RRR
d=SSS

if a in S:
   print(1)

elif b in S:
    print(2)
    
elif c = S:
    print(3)
    
elif d = S:
    print(0)

else:
    print(1)

Buggy submission (verdict: Runtime Error):
ans = 0

if (a==s,b==s,c==s):
    print(ans)

elif (a==r,b==s,c==s):
    ans = 1 + ans
    print(ans)

elif (a==r,b==r,c==s):
    ans = 2 + ans
    print(ans)

else:
    ans = 1 + ans
    print(ans)
Problem p03455 (python)

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


A = a*b % 2

if A==0:
    print("Even")

else:
    print("Odd")

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

for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t or (x + y + t) % 2:
    print("No")
    exit()
  print("Yes")

Buggy submission (verdict: Runtime Error):
impport sys

n = int(input())

for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t or (x + y + t) % 2:
    print("No")
    sys.exit()
  print("Yes")

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

for i in range(n):
    t,x,y = map(int,input().split())
    if (x + y) > t or (x + y + t) % 2:
        print("No")
        exit()
    print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  t,x,y = map(int,input().split())
  if (x + y) > t :
    print("No")
    exit()
print("Yes")
Problem p03493 (python)

Fixed submission:
D = input()

A="1"
B="11"
C="101"
F="111"

if F == D:
    print(3)
    
elif B in D:
    print(2)

elif C == D:
    print(2)

elif A in D:
    print(1)

else:
    print(0)

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

print(a+b+c)
Problem p02574 (python)

Fixed submission:

max_val = int(1e+6+1)
def make_kago(x):
    kago = [0 for _ in range(x+1)]
    sosuu = []
    for i in range(2,x+1):
        if kago[i] != 0:
            continue
        sosuu.append(i)
        for j in range(i, x+1, i):
            if kago[j] == 0:
                kago[j] = i
    return kago, sosuu

kago, sosuu = make_kago(max_val)

def prime_factorization(x):
    if x==0:
        return None
    soinsuu = []
    while x!=1:
        soinsuu.append(kago[int(x)])
        x = x/kago[int(x)]
    
    soinsuu_dict = dict()
    for i in range(len(soinsuu)):
        if soinsuu[i] not in soinsuu_dict:
            soinsuu_dict[soinsuu[i]] = 1
        else:
            soinsuu_dict[soinsuu[i]]+=1
    return soinsuu_dict

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

exists = [0 for _ in range(int(1e+6+1))]

complete_ok = True
exist_one = False

for i, A in enumerate(As):
    if A == 1:
        continue
    soinsuu_dict = prime_factorization(A)
    keys = list(soinsuu_dict.keys())
    for key in keys:
        if exists[key] != 0:
            complete_ok = False
        exists[key] += 1

part_ok = False
for i in range(len(exists)):
    if exists[i] == len(As):
        part_ok = True

if complete_ok == True:
    print("pairwise coprime")
elif part_ok == False:
    print("setwise coprime")
else:
    print("not coprime")

Buggy submission (verdict: Runtime Error):

max_val = int(1e+6+1)
def make_kago(x):
    kago = [0 for _ in range(x+1)]
    sosuu = []
    for i in range(2,x+1):
        if kago[i] != 0:
            continue
        sosuu.append(i)
        for j in range(i, x+1, i):
            if kago[j] == 0:
                kago[j] = i
    return kago, sosuu

kago, sosuu = make_kago(max_val)

def prime_factorization(x):
    if x==0 or x==1:
        return None
    soinsuu = []
    while x!=1:
        soinsuu.append(kago[int(x)])
        x = x/kago[int(x)]
    
    soinsuu_dict = dict()
    for i in range(len(soinsuu)):
        if soinsuu[i] not in soinsuu_dict:
            soinsuu_dict[soinsuu[i]] = 1
        else:
            soinsuu_dict[soinsuu[i]]+=1
    return soinsuu_dict

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

exists = [0 for _ in range(int(1e+6+1))]

complete_ok = True
for i, A in enumerate(As):
    soinsuu_dict = prime_factorization(A)
    keys = list(soinsuu_dict.keys())
    for key in keys:
        if exists[key] != 0:
            complete_ok = False
        exists[key] += 1

part_ok = False
for i in range(len(exists)):
    if exists[i] == len(As):
        part_ok = True

if complete_ok == True:
    print("pairwise coprime")
elif part_ok == False:
    print("setwise coprime")
else:
    print("not coprime")
Problem p02662 (python)

Fixed submission:
n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353

dp = [0 for _ in range(s+1)]
dp[0] = 1

for i in range(n):
    plus = [dp[j-a[i]]  if j-a[i] >=0 else 0 for j in range(s+1)]
    for j in range(s+1):
        dp[j] = (dp[j]*2 +plus[j])%mod

print(dp[s])

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

print(1)

Buggy submission (verdict: Runtime Error):
import numpy as np
n, s = map(int, input().split())
a = list(map(int, input().split()))

dp = np.array([0 for _ in range(s+1)])
dp[0] = 1

for i in range(n):
    plus = [dp[j-a[i]]  if j-a[i] >=0 else 0 for j in range(s+1)]
    dp = dp*2
    dp = dp+plus

print(dp[s])
Problem p02686 (python)

Fixed submission:
import sys
N = int(input().rstrip('\n'))
S = [str(input().rstrip('\n')) for _ in range(N)]

plus_stock = []
minus_stock = []
for i, row in enumerate(S):
    lowest = 0
    now = 0
    for j,char in enumerate(row):
        if char == "(":
            now+=1
        elif char == ")":
            now-=1 
        if now < lowest:
            lowest = now
    if now >= 0:
        plus_stock.append([now, lowest])
    elif now < 0:
        minus_stock.append([-now, lowest - now])
plus_stock  = sorted(plus_stock, key = lambda x:x[1], reverse=True)
minus_stock = sorted(minus_stock, key = lambda x:x[1], reverse=True)

now = 0

for i in range(len(plus_stock)):
    if now + plus_stock[i][1] < 0:
        print("No")
        sys.exit()
    else:
        now = now+plus_stock[i][0]
last = now
now = 0
for i in range(len(minus_stock)):
    if now + minus_stock[i][1] < 0:
        print("No")
        sys.exit()
    else:
        now = now+minus_stock[i][0]
if last == now:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import sys
N = int(f.input())
S = [str(f.input()) for _ in range(N)]

plus_stock = []
minus_stock = []
for i, row in enumerate(S):
    lowest = 0
    now = 0
    for j,char in enumerate(row):
        if char == "(":
            now+=1
        elif char == ")":
            now-=1 
        if now < lowest:
            lowest = now
    if now >= 0:
        plus_stock.append([now, lowest])
    else:
        minus_stock.append([-now, lowest - now])
plus_stock  = sorted(plus_stock, key = lambda x:x[1])
minus_stock = sorted(minus_stock, key = lambda x:x[1])

now = 0

for i in range(len(plus_stock)):
    if now + plus_stock[i][1] < 0:
        print("No")
        sys.exit()
    else:
        now = now+plus_stock[i][0]
last = now
now = 0
for i in range(len(minus_stock)):
    if now + minus_stock[i][1] < 0:
        print("No")
        sys.exit()
    else:
        now = now+minus_stock[i][0]
if last == now:
    print("Yes")
else:
    print("No")
Problem p02702 (python)

Fixed submission:
S = input()
mod2019 = [0]*len(S)

mod2019[-1] = int(S[-1])
keta_mod = 1
for i in range(len(S)-2,-1,-1):
    keta_mod = (keta_mod*10)%2019
    mod2019[i] = (mod2019[i+1] + int(S[i])*keta_mod)%2019

mod2019.extend([0])

answer = 0
count = [0 for _ in range(2020)]

for i in range(len(S)+1):
    answer += count[mod2019[i]]
    count[mod2019[i]] += 1
print(answer)

Buggy submission (verdict: Runtime Error):
S = input()
mod2019 = [0]*len(S)

for i in range(len(S)):
    mod2019[i] = int(S[i:])%2019

mod2019.extend(0)

answer = 0
count = [0 for _ in range(2020)]


for i in range(len(S)):
    answer += count[mod2019[i]]
    count[mod2019[i]] += 1
print(answer)

Buggy submission (verdict: Runtime Error):
S = input()
mod2019 = [0]*(len(S)+1)

for i in range(len(S)):
    mod2019[i] = int(S[i:len(S)-1])%2019

answer = 0
count = [0 for _ in range(2020)]


for i in range(len(S)):
    answer += count[mod2019[i]]
    count[mod2019[i]] += 1
print(answer)

Buggy submission (verdict: Runtime Error):
S = input()
mod2019 = [0]*(len(S)+1)

for i in range(len(S)):
    mod2019[i] = int(S[i:-1])%2019

answer = 0
count = [0 for _ in range(2020)]


for i in range(len(S)):
    answer += count[mod2019[i]]
    count[mod2019[i]] += 1
print(answer)
Problem p02733 (python)

Fixed submission:
H, W, K = map(int, input().split())
Ss = [list(map(int, input().replace("\n", ""))) for _ in range(H)]

cut_yoko_patterns = ["0","1"]
options = ["0","1"]

import copy

for i in range(H-2):
    cut_yoko_patterns = [cut_yoko_patterns[i] + options[j] for i in range(len(cut_yoko_patterns)) for j in range(len(options))]

answer = int(1e+5)
for cut_yoko_pattern in cut_yoko_patterns:
    yoko_cut_num = cut_yoko_pattern.count("1")
    boxs = [0 for _ in range(yoko_cut_num+1)]
    box_num = [0 for _ in range(H)]
    for i in range(H-1):
        if cut_yoko_pattern[i] == "1":
            box_num[i+1] = box_num[i] + 1
        else:
            box_num[i+1] = box_num[i]
    
    tate_cut_num = 0
    for j in range(W):
        temp_boxs = [0 for _ in range(yoko_cut_num+1)]
        for i in range(H):
            if Ss[i][j] == 1:
                temp_boxs[box_num[i]] += 1
        Impossible = False
        Should_cut = False
        for i in range(yoko_cut_num+1):
            if temp_boxs[i] > K:
                Impossible = True
            
            elif boxs[i] + temp_boxs[i] > K:
                Should_cut = True
        
        if Impossible == True:
            break
        elif Should_cut ==True:
            boxs = copy.deepcopy(temp_boxs)
            tate_cut_num += 1
        else:
            for i in range(yoko_cut_num+1):
                boxs[i] += temp_boxs[i]
    else:
        
        if tate_cut_num+yoko_cut_num < answer:
            answer = tate_cut_num + yoko_cut_num
print(answer)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 20:56:06 2020

@author: naoki
"""
import math
f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
H, W, K = map(int, input().split())
S = [list(map(int,str(input()).replace('\n',''))) for _ in range(H)]
t_S = [[S[j][i] for j in range(len(S))]for i in range(len(S[0]))]

sum_gyo = [sum(gyo) for gyo in S]
sum_retu = [sum(retu) for retu in t_S]

katamari = [sum(sum_retu)]

if katamari[0] > K:
    print(math.ceil(katamari[0]/K))
else:
    print(0)
Problem p02743 (python)

Fixed submission:


from decimal import Decimal
from decimal import *
a, b, c = map(str, input().split())

getcontext().prec = 500

a = Decimal(a)
b = Decimal(b)
c = Decimal(c)

if a**Decimal("0.5")  + b**Decimal("0.5") < c**Decimal("0.5"):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 14 21:02:42 2020

@author: morihiranaoki
"""
import numpy as np
from decimal import Decimal
a, b, c = map(str, input().split())


a = Decimal(a)
b = Decimal(b)
c = Decimal(c)

if a**Decimal("0.5")  + b**Decimal("0.5") < c**Decimal("0.5"):
    print("Yes")
else:
    print("No")
Problem p02789 (python)

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

if n == m:
  print("Yes")
else:
  print("No")

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

    count = 1
    for i in range(1,N):
        for p in range(i):
            if P[p] < P[i]:
                break
        else:
            count += 1
    print(count)
if __name__ == '__main__':
    main()
Problem p02796 (python)

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 07:49:36 2020

@author: naoki
"""
N = int(input())
xl = [list(map(int, input().split())) for _ in range(N)]

left_right = [[row[0]-row[1], row[0]+row[1]] for row in xl]
left_right = sorted(left_right, key = lambda x:int(x[1]))
count = 0
now = -100000000000
for row in (left_right):
    if row[0] < now:
        continue
    else:
        count += 1
        now = row[1]
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 07:49:36 2020

@author: naoki
"""
N = int(input())
xl = [list(map(int, input())) for _ in range(N)]

left_right = [[row[0]-row[1], row[0]+row[1]] for row in xl]
left_right = sorted(left_right, key = lambda x:int(x[1]))
count = 0
now = -10000
for row in (left_right):
    if row[0] < now:
        continue
    else:
        count += 1
        now = row[1]
print(count)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 07:49:36 2020

@author: naoki
"""


N = int(input())
xl = [list(map(int, input())) for _ in range(N)]

left_right = [[row[0]-row[1], row[0]+row[1]] for row in xl]
left_right = sorted(left_right, key = lambda x:int(x[1]))
count = 0
now = -10000
for row in (left_right):
    if row[0] < now:
        continue
    else:
        count += 1
        now = row[1]

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 07:49:36 2020

@author: naoki
"""

f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")

N = int(input())
xl = [list(map(int, input())) for _ in range(N)]

left_right = [[row[0]-row[1], row[0]+row[1]] for row in xl]
left_right = sorted(left_right, key = lambda x:int(x[1]))
count = 0
now = -10000
for row in (left_right):
    if row[0] < now:
        continue
    else:
        count += 1
        now = row[1]