qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a, b = map(int, input().split())
if a == b:
    print(a*2-1)
else:
    m = max(a, b)
    print(m*2-1)

Fixed code:
a, b = map(int, input().split())
if a == b:
    print(a*2)
else:
    m = max(a, b)
    print(m*2-1)
Buggy code:
A, B = map(int, input().split())
max(A*2-1, A + B, B*2-1)

Fixed code:
A, B = map(int, input().split())
print (max(A*2-1, A + B, B*2-1))
Buggy code:
# coding: utf-8
A, B = map(int, input().split())
print(max(A, B) * 2 - 1)


Fixed code:
# coding: utf-8
A, B = map(int, input().split())
if A == B:
    print(A * 2)
else:
    print(max(A, B) * 2 - 1)
Buggy code:
a = [int(i) for i in input().split()]~


output = max(a)

b = a.index(max(a))

a[b] = a[b] - 1

output = output + max(a)

print(output)


Fixed code:
a = [int(i) for i in input().split()]
output = max(a)

b = a.index(max(a))

a[b] = a[b] - 1

output = output + max(a)

print(output)
Buggy code:
a,b=map(int,input().split())
ans=0
if max(a,b)==a:
  ans=ans+a
  a=a-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1
  elif max(a,b)==b:
    ans=ans+b
    b=b-1
elif max(a,b)==b:
    ans=ans+b
    b=b-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1    
  elif max(a,b)==b:
    ans=ans+b
    b=b-1      
print(ans)   
    

Fixed code:
a,b=map(int,input().split())
ans=0
if max(a,b)==a:
  ans=ans+a
  a=a-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1
  elif max(a,b)==b:
    ans=ans+b
    b=b-1
elif max(a,b)==b:
  ans=ans+b
  b=b-1
  if max(a,b)==a:
    ans=ans+a
    a=a-1    
  elif max(a,b)==b:
    ans=ans+b
    b=b-1      
print(ans)
Buggy code:
a,b=map(int,input().split())
if a==b:
  print(2*a)
else:
  print(2*a-1)

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

if a == b:
    print(a + b)
else:
    print(2 * max(a, b) - 1)
Buggy code:
data = input()
a,b = data.split()
if(a==b):
  print(a+b)
elif(a>b):
  print(2*a-1)
else:
  print(2*b-1)

Fixed code:
data = input()
a,b = data.split()
a = int(a)
b = int(b)
if(a==b):
  print(a+b)
elif(a>b):
  print(2*a-1)
else:
  print(2*b-1)
Buggy code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Hlist = input().split()
nlist = []
for t in Hlist:
    nlist.append(int(t))
k = nlist[0]
p = 1
for t in range(1,len(nlist)):
    if nlist[t] >= k:
        p+=1
        k = nlist[t]
    else:
        k = nlist[t-1]
print(p)

Fixed code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
Hlist = input().split()
nlist = []
for t in Hlist:
    nlist.append(int(t))
k = nlist[0]
maxlist = [nlist[0]]
p = 1
for t in range(1,len(nlist)):
    if nlist[t] >= max(maxlist):
        p+=1
        maxlist.append(nlist[t])
    else:
        maxlist.append(nlist[t])
print(p)
Buggy code:
N=int(input())
H=list(map(int,input().split()))
ans=0
for i in range(1,N):
    if H[i]>=H[1:i-1]:
        ans+=1
print(ans+1)

Fixed code:
N=int(input())
H=list(map(int,input().split()))
ans=0
for i in range(1,N):
    if H[i]>=max(H[:i]):
        ans+=1
print(ans+1)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
ans = 1
for i in range(1,N-1):
  flag = 0
  for j in range(i):
    if H[i]<H[j]:
      flag=1
  if flag == 0:
    ans+=1
print(ans)


Fixed code:
N = int(input())
H = list(map(int,input().split()))
ans = 1
for i in range(1,N):
  flag = 0
  for j in range(i):
    if H[i]<H[j]:
      flag=1
  if flag == 0:
    ans+=1
print(ans)
Buggy code:
n=int(input())
a=list(map(int, input().split()))
ans=0
h=0
for i in a:
    if i>h:
        ans+=1
        h=i
print(ans)

Fixed code:
n=int(input())
a=list(map(int, input().split()))
ans=0
h=0
for i in a:
    if i>=h:
        ans+=1
        h=i
print(ans)
Buggy code:
n = int(input())
h = [int(n) for n in input().split()]

max = h[0]
ans = 1

for i in h:
    if max<i:
        ans += 1
        max = i
print(ans)

Fixed code:
n = int(input())
h = [int(n) for n in input().split()]

max = h[0]
ans = 0

for i in h:
    if max<=i:
        ans += 1
        max = i
print(ans)
Buggy code:
from sys import stdin
n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]
ans = 1
tmp = h[0]
for i in range(n - 1):
    ans += 1 if tmp <= h[i + 1] else 0
    tmp = max(h[i], h[i + 1])
print("{}".format(ans))

Fixed code:
from sys import stdin
n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]
ans = 1
tmp = h[0]
for i in range(n - 1):
    ans += 1 if tmp <= h[i + 1] else 0
    tmp = max(tmp, h[i + 1])
print("{}".format(ans))
Buggy code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n = ni()
h = na()

c = 1
maxh = h[0]
for i in range(n-1):
    if maxh <= h[i+1]:
        c += 1
        maxh = h[i]


print(c)


Fixed code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

n = ni()
h = na()

c = 1
maxh = h[0]
for i in range(n-1):
    if maxh <= h[i+1]:
        c += 1
        maxh = h[i+1]

print(c)
Buggy code:
import sys
n=int(input())
h=list(map(int, input().split()))
count=0
max=0
for i in range(n-1):
    if h[i]>=max:
        max=h[i]
        count+=1
print(count)

Fixed code:
import sys
n=int(input())
h=list(map(int, input().split()))
count=0
max=0
for i in range(n):
    if h[i]>=max:
        max=h[i]
        count+=1
print(count)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
saidai = 0
cnt = 0

for i in H:
    print(N)
    if(i >= saidai):
        saidai = i
        cnt += 1
    

print(cnt)

Fixed code:
N = int(input())
H = list(map(int,input().split()))
saidai = 0
cnt = 0

for i in H:
    if(i >= saidai):
        saidai = i
        cnt += 1
    

print(cnt)
Buggy code:
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  if i > 0 :
  	for j in range(i):
  		if not (a[j] =< a[i]):
      		continue
  out += 1
print(out)

Fixed code:
n=int(input())
a=list(map(int,input().split()))
out = 0
for i in range(len(a)):
  flg = 1
  if i > 0 :
    for j in range(i):
      if not (a[j] <= a[i]):
        flg = 0
  if flg == 1:
    out += 1
print(out)
Buggy code:
n = input()
h = list(map(int, input().split()))
count = 1


for i in range(int(n)):
    if i!=0:
        for j in range(i):
            ok = 0
            if h[j]<=h[i]:
                ok +=1
            if ok == i:
                count +=1

print(count)


Fixed code:
n = input()
h = list(map(int, input().split()))
count = 1


for i in range(int(n)):
    ok = 0
    if i!=0:
        for j in range(i):

            if h[j]<=h[i]:
                ok +=1
            if ok == i:
                count +=1

print(count)
Buggy code:
N=int(input())
H=[int(x) for x in input().split()]
can_watch = 0
for i in range(N):
  if H[i] >= max(H[:i]):
    can_watch = can_watch + 1
  else:
    pass
print(can_watch)

Fixed code:
N=int(input())
H=[int(x) for x in input().split()]
can_watch = 0
for i in range(N):
  if i > 0:
    if H[i] >= max(H[:i]):
      can_watch = can_watch + 1
    else:
      pass
  else:
    can_watch = can_watch + 1
print(can_watch)
Buggy code:
N = int(input())
H = list(map(int, input().split()))

_count=1
max_height=H[0]

for i in range(1,N):
    if max_height <= H[i]:
        count +=1
        max_height = H[i]
print(_count)


Fixed code:
N = int(input())
H = list(map(int, input().split()))

_count=1
max_height=H[0]

for i in range(1,N):
    if max_height <= H[i]:
        _count +=1
        max_height = H[i]
print(_count)
Buggy code:
n = int(input())
h = [int(i) for i in input().split()]
a = 0
for i in range(len(h)):
    if h[i] >= max(h[0:i-1]):
        a += 1
print(a)

Fixed code:
n = int(input())
h = [int(i) for i in input().split()]
a = 0
for i in range(len(h)):
    if i == 0:
        a += 1
    else:
        if h[i] >= max(h[0:i]):
            a += 1
print(a)
Buggy code:
N = int(input())

H = list(map(int, input().split()))

cansee = False
count = 0

for i in range(N-1):
    cansee = True
    for j in range(i):
        if H[j] > H[i]:
            cansee = False
    if cansee:
        count += 1

print(count)

Fixed code:
N = int(input())

H = list(map(int, input().split()))

count = 0

for i in range(N):
    cansee = True
    for j in range(i):
        if H[j] > H[i]:
            cansee = False
    
    if cansee:
        count += 1

print(count)
Buggy code:
n = int(input())
h = list(map(int,input().split(' ')))
ans = 1
i = 1
h0 = h[0]
while i < n:
    if h[i] > h0:
        ans += 1
        h0 = h[i]
    i += 1
print(ans)

Fixed code:
n = int(input())
h = list(map(int,input().split(' ')))
ans = 1
i = 1
h0 = h[0]
while i < n:
    if h[i] >= h0:
        ans += 1
        h0 = h[i]
    i += 1
print(ans)
Buggy code:
N = int(input())
H = list(map(int , input().split()))

can_see_ocean = 1

for i in range(1 , N+1):
    compare_high = H[0:i+1]
    if max(compare_high) == H[i-1]:
        can_see_ocean += 1
        
print(can_see_ocean)

Fixed code:
N = int(input())
H = list(map(int , input().split()))

can_see_ocean = 0

for i in range(N):
    compare_high = H[0:i+1]
    if max(compare_high) == H[i]:
        can_see_ocean += 1
        
print(can_see_ocean)
Buggy code:
N = int(input())
H = list(map(int,input().split()))

c = 0

for i in range(N):
    d = 0

    for j in range(i):
        #print(H[i], H[j])
        if H[i] > H[j] or H[i] == H[j]:
            d += 1
    if d == i:
        c += 1
c

Fixed code:
N = int(input())
H = list(map(int,input().split()))

c = 0

for i in range(N):
    d = 0

    for j in range(i):
        #print(H[i], H[j])
        if H[i] > H[j] or H[i] == H[j]:
            d += 1
    if d == i:
        c += 1
print(c)
Buggy code:
n=int(input())
h=list(map(int, input().split()))
ans=0
for i in range(n):
    if h[i]>=h[0]:
        ans=ans+1  
print(ans)

Fixed code:
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[i]>=ans:
        x=x+1 
        ans=h[i]
print(x)
Buggy code:
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  if H[i+1] >= H[i]:
    ans += 1
print(ans+1)

Fixed code:
N = int(input())
H = list(map(int, input().split()))
ans = 0
max = H[0]
for i in range(N-1):
  if H[i+1] >= max:
    ans += 1
    max = H[i+1]
print(ans+1)
Buggy code:
n=int(input())
li=list(map(int,input().split()))
count=0
for i in range(1,n):
  if li[i] >= max(li[0:i])
    count +=1
print(count+1)

Fixed code:
n=int(input())
li=list(map(int,input().split()))
count=0
for i in range(1,n):
  if li[i] >= max(li[0:i]):
    count +=1
print(count+1)
Buggy code:
n=int(input())
h=list(map(int, input().split())) 
pre_h = 0
cnt = 0
for i in range(n):
    if h[i] >= pre_h:
        cnt += 1
    pre_h = h[i]
print(cnt)

Fixed code:
n=int(input())
h=list(map(int, input().split())) 
max_h = 0
cnt = 0
for i in range(n):
    if h[i] >= max_h:
        cnt += 1
        max_h = h[i]
print(cnt)
Buggy code:
#ABC124B
N = int(input())
H = list(map(int, input().split()))
maxH = 0
ans = 1
for i in range(1,N):
    if H[i-1] <= H[i]:
        ans += 1
        maxH = H[i]
print(ans) 

Fixed code:
#ABC124B
N = int(input())
H = list(map(int, input().split()))
maxH = H[0]
ans = 1
for i in range(1,N):
    if maxH <= H[i]:
        ans += 1
        maxH = H[i]
print(ans)
Buggy code:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    cnt = 0
    for i in range(0, n):
        diff = [h_n[i] - h_n[i] for j in range(0, i)]
        cnt = cnt + 1 if len(list(filter(lambda x: x < 0, diff))) == 0 else cnt

    print(cnt)
    
main()

Fixed code:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    cnt = 0
    for i in range(0, n):
        diff = [h_n[i] - h_n[j] for j in range(0, i)]
        cnt = cnt + 1 if len(list(filter(lambda x: x < 0, diff))) == 0 else cnt

    print(cnt)

    
main()
Buggy code:
N=int(input())
H=list(map(int,input().split()))

cnt=0
highest=H[0]

for i in range(1,N):
  if highest<=H[i]:
    cnt+=1
    highest=H[i]

print(cnt)

Fixed code:
N=int(input())
H=list(map(int,input().split()))

cnt=0
highest=H[0]

for i in range(N):
  if highest<=H[i]:
    cnt+=1
    highest=H[i]

print(cnt)
Buggy code:
n = int(input())
h = list(map(int, input().split()))

count = 0

for num, hight in enumerate(h):
  if h[num] >= max(h[:num]):
    count += 1

print(count)

Fixed code:
n = int(input())
h = list(map(int, input().split()))

count = 0

for num, hight in enumerate(h):
  if hight >= max(h[:num+1]):
    count += 1

print(count)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
P = []
ans = 1
P.append(H[0])
for i in range(1,N):
    if H[i] >= max(P):
        ans += 1

print(ans)

Fixed code:
N = int(input())
H = list(map(int,input().split()))
P = []
ans = 1
P.append(H[0])
for i in range(1,N):
    if H[i] >= max(P):
        ans += 1
    P.append(H[i])

print(ans)
Buggy code:
n = int(input())
h = list(map(int, input().split()))

c = 0

for i in h:
  t = True
  for j in range(i):
    if h[j] >= h[i]:
      t = False
      break
   c += 1

Fixed code:
n = int(input())
h = list(map(int, input().split()))

c = 0

for i in range(n):
  t = True
  for j in range(i):
    if h[j] > h[i]:
      t = False
      break
  if t == True:
    c += 1
  t = True
print(c)
Buggy code:
# -*- coding: utf-8 -*-

def main(N, H):
    count = 1
    for i in range(1, N):
        if(H[i]>=H[i-1]):
            count += 1
            
    print(count)

if __name__ == '__main__':
    N = int(input())
    H = [int(h) for h in input().split()]
    
    main(N, H)

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

def main(N, H):
    count = 1
    max = H[0]
    for i in range(1, N):
        if(H[i]>=max):
            count += 1
            max = H[i]
            
    print(count)

if __name__ == '__main__':
    N = int(input())
    H = [int(h) for h in input().split()]
    
    main(N, H)
Buggy code:
N = int(input())
H = list(map(int, input().split()))
cnt = 1
for i in range(2, N):
    if H[0] <= H[i] and H[i-1] <= H[i]:
        cnt += 1
print(cnt)

Fixed code:
N = int(input())
H = list(map(int, input().split()))
cnt = 1
m = H[0]
for i in range(1, N):
    if m <= H[i] and H[i-1] <= H[i]:
        cnt += 1
        m = max(H[0], H[i])

print(cnt)
Buggy code:
it = int(input())
lists = list(map(int,input().split()))
x = 0
i = it - 1

for j in range(i):
  listo = lists[:j+1]
  if max(listo) == lists[j]:
    x += 1
  else:
    continue

print(x)

Fixed code:
it = int(input())
lists = list(map(int,input().split()))
x = 0
i = it 

for j in range(i):
  listo = lists[:j+1]
  if max(listo) == lists[j]:
    x += 1
  else:
    continue

print(x)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
ans = 1
maxH = h[0]

for i in range(1, n):
    if h[i] >= maxH:
	ans += 1
	maxH = h[i]

print(ans)


Fixed code:
n = int(input())
h = list(map(int, input().split()))
ans = 1
maxH = h[0]

for i in range(1, n):
    if h[i] >= maxH:
        ans += 1
        maxH = h[i]

print(ans)
Buggy code:
n = int(input())
h = list(map(int,input().split()))
ans=1
for j in range(1,n):
    if(h[j]>=h[0]:
       ans+=1
print(ans)

Fixed code:
n = int(input())
h = list(map(int,input().split()))
ans=1
tp=h[0]
for j in range(1,n):
    if(h[j]>=tp):
        tp=h[j]
        ans+=1
print(ans)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
ans = 1
m = 0
for i in range(N):
    if m <= H[i]:
        ans += 1
    m = max(m,H[i])
print(ans)


Fixed code:
N = int(input())
H = list(map(int,input().split()))
ans = 0
m = 0
for i in range(N):
    if m <= H[i]:
        ans += 1
    m = max(m,H[i])
print(ans)
Buggy code:
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(hotel(i))
  if hotel(i) == max(new):
    count += 1
print(count)

Fixed code:
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(i)
  if i == max(new):
    count += 1
print(count)
Buggy code:
n=input()
H=list(map(int, input().split()))
Hi=0;a=0
for i in range(N):
  if H[i]>Hi:
    Hi=H[i]
    a+=1
  elif H[i]=Hi:
    a+=1
print(a)

Fixed code:
N=int(input())
H=list(map(int, input().split()))
Hi=0;a=0
for i in range(N):
  if int(H[i])>Hi:
    Hi=int(H[i])
    a+=1
  elif int(H[i])==Hi:
    a+=1
print(a)
Buggy code:
n = int(input())
h = list(map(int,input().split()))

c = 0
highest = 0
for i in range(n):
	if highest <= h[i]:
		c += 1
        highest = h[i]

print(c)

Fixed code:
n = int(input())
h = list(map(int,input().split()))

c = 0
highest = 0
for i in range(n):
	if highest <= h[i]:
		c += 1
		highest = h[i]

print(c)
Buggy code:
n=int(input())
a=map(int,input().split())
minn=0
ans=0
for i in a:
  if i>=minn:
    ans+=1
    minn=ans
print(ans)

Fixed code:
n=int(input())
a=map(int,input().split())
minn=0
ans=0
for i in a:
  if i>=minn:
    ans+=1
    minn=i
print(ans)
Buggy code:
N=int(input())
H=list(map(int,input().split()))

count=1
l=H[0]
for i in range(N-1):
  if H[i+1]-l>0:
    count +=1
    l=H[i+1]
print(count)

Fixed code:
N=int(input())
H=list(map(int,input().split()))

count=1
l=H[0]
for i in range(N-1):
  if H[i+1]-l>=0:
    count +=1
    l=H[i+1]
print(count)
Buggy code:
mount_count = input()
mount_heights = input()
mount_heights_list = mount_heights.split()
count = 0
max_height = int(mount_heights_list[0])
for mount_height in mount_heights_list:
    if max_height <= int(mount_height):
        count += 1
print(count)

Fixed code:
mount_count = input()
mount_heights = input()
mount_heights_list = mount_heights.split()
count = 0
max_height = int(mount_heights_list[0])
for mount_height in mount_heights_list:
    if max_height <= int(mount_height):
        max_height = int(mount_height)
        count += 1
print(count)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
count = 1
x = H[0]
for i in range(N-1):
     if x <=H[i]:
         x = H[i]
         count += 1

print(count)
     


Fixed code:
N = int(input())
H = list(map(int,input().split()))
count = 1
x = H[0]
for i in range(N-1):
     if x <=H[i+1]:
         x = H[i+1]
         count += 1

print(count)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
high = h[0]
ans = 1
for i in range(n):
    if high <= h[i]:
        ans += 1
        high = h[i]

print(ans)

Fixed code:
n = int(input())
h = list(map(int, input().split()))
high = h[0]
ans = 1
for i in range(1,n):
    if high <= h[i]:
        ans += 1
        high = h[i]

print(ans)
Buggy code:
li = list(map(int,input().split()))
i=0
c=0
a=0
for n in li:
  while c<i:
    if li[c]>n:
      break
    else:
      a+=1
    c+=1
  i+=1
print(a)
    

Fixed code:
x=int(input())
li = list(map(int,input().split()))
i=0
c=0
a=1
for n in li:
  while c<i:
    if li[c]>n:
      break
    c+=1
    if c==i:
      a+=1
  c=0  
  i+=1
print(a)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
max_mount = h[0]
cnt = 0 
for i in range(n):
    if max_mount<=h[i]:
    	ans +=1
    	max_mount = h[i]
print(ans)

Fixed code:
n = int(input())
h = list(map(int, input().split()))
max_mount = h[0]
ans = 0 
for i in range(n):
    if max_mount<=h[i]:
    	ans +=1
    	max_mount = h[i]
print(ans)
Buggy code:
N = int(input())
H = map(int, input().split())

cnt = 0
for i in range(len(H)):
    if (max(H[0:i+1]) == H[i]):
        cnt += 1

print(cnt)


Fixed code:
N = int(input())
H = list(map(int, input().split()))

cnt = 0
for i in range(len(H)):
    if (max(H[0:i+1]) == H[i]):
        cnt += 1

print(cnt)
Buggy code:
n=int(input())
h=[list(map(int,input().split()))]
high=0
count=0
for i in range(n):
  if high<=h[i]:
    count=count+1
    high=h[i]
print(count)

Fixed code:
n=int(input())
h=list(map(int,input().split()))
high=0
count=0
for i in range(n):
  if high<=h[i]:
    count=count+1
    high=h[i]
print(count)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
cnt = 1

for i in range(1,n):

    if h[i] > max(h[:i]):
        cnt += 1

print(cnt)

Fixed code:
n = int(input())
h = list(map(int, input().split()))
cnt = 1

for i in range(1,n):

    if h[i] >= max(h[:i]):
        cnt += 1

print(cnt)
Buggy code:
N = int(input())
arr = input().split()
num = 1
tmp = arr[0]

for i in range(N-1):
	if arr[i+1] > tmp:
		num += 1
		tmp = arr[i+1]

print(num)


Fixed code:
N = int(input())
arr = input().split()
num = 0
tmp = 0

for i in range(N):
	if int(arr[i]) >= tmp:
		num += 1
		tmp = int(arr[i])

print(num)
Buggy code:
N = int(input())
H = list(map(int, input().split(" ")))

count = 0

for c in range(N):
    if c == 0:
        H_max = H[c]
        count += 1
    else:
        if H_max < H[c]:
            H_max = H[c]
            count += 1
        else:
            pass

print(count)
        

Fixed code:
N = int(input())
H = list(map(int, input().split(" ")))

count = 0

for c in range(N):
    if c == 0:
        H_max = H[c]
        count += 1
    else:
        if H_max <= H[c]:
            H_max = H[c]
            count += 1
        else:
            pass

print(count)
Buggy code:
a = int(input())
x = list(map(int,input().split()))
m = x[0]
s = 0
for i in range(1,a):
  if m < x[i]:
    m = x[i]
    s+=1
print(s+1)

Fixed code:
a = int(input())
x = list(map(int,input().split()))
m = x[0]
s = 0
for i in range(1,a):
  if m <= x[i]:
    m = x[i]
    s+=1
print(s+1)
Buggy code:
N = input()
s = input().split()
count = 1
for i in range(1,N+1):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)


Fixed code:
N = int(input())
s = input().split()
count = 1
for i in range(N):
  s[i] = int(s[i])
for i in range(1,N):
  t = s[:i]
  if max(t) <= s[i]:
    count = count + 1
print(count)
Buggy code:
n=int(input())
h_list=[int(i) for i in input().split()]
b = 1  # counter
c = 1  # answer
m = h_list[0]  # max height
while b != (n - 1):
    if h_list[b] > m:
        c += 1
    b += 1
print(c)

Fixed code:
n=int(input())
h_list=[int(i) for i in input().split()]
b = 1  # counter
c = 1  # answer
m = h_list[0]  # max height
while b != n:
    if h_list[b] >= m:
        m = h_list[b]
        c += 1
    b += 1
print(c)
Buggy code:
hpi = input()
k = list(map(int, input().split(" ")))
for c in range(int(hpi) - 1):
  jo = "yes"
  n = k[:c + 2]
  for co in range(len(n) - 1):
    if n[co] > k[c]:
      jo = "no"
    else:
      pass
  if jo == "yes":
    count += 1
print(count + 1)

Fixed code:
hpi = input()
count = 1
k = list(map(int, input().split(" ")))
for c in range(int(hpi) - 1):
  jo = "yes"
  n = k[:c + 2]
  for co in range(len(n) - 1):
    if n[co] > k[c + 1]:
      jo = "no"
    else:
      pass
  if jo == "yes":
    count += 1
print(count)
Buggy code:
import math
import os
import random
import re
import sys
from collections import defaultdict

sys.stdin = open('input.in', 'r')
sys.stdout = open('output.out', 'w') 

def count(n, h):
	count = 0
	if len(h) < 1:
		return count
	max = h[0]
	for i in h:
		if i >= max:
			max = i 
			count += 1

	return count

if __name__ == '__main__':
	n = int(input())
	h = list(map(int, input().rstrip().split()))
	print(count(n, h))

Fixed code:
import math
import os
import random
import re
import sys
from collections import defaultdict

# sys.stdin = open('input.in', 'r')
# sys.stdout = open('output.out', 'w') 

def count(n, h):
	count = 0
	if len(h) < 1:
		return count
	max = h[0]
	for i in h:
		if i >= max:
			max = i 
			count += 1

	return count

if __name__ == '__main__':
	n = int(input())
	h = list(map(int, input().rstrip().split()))
	print(count(n, h))
Buggy code:
n = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(n):
    if i == 0 or p[i-1] < p[i]:
        count += 1
print(count)

Fixed code:
n = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(n):
    if i == 0 or max_ <= p[i]:
        max_ = p[i]
        count += 1
print(count)
Buggy code:
def sub():
    N, Hs = [input() for _ in range(2)]
    Hs = [int(e) for e in Hs.split(" ")]
    count = 1
    maxH = Hs[0]
    for i in range(1, N):
        h = Hs[i]
        if h >= maxH:
            count = count + 1
            maxH = h


    print("{}".format(count))

sub()



Fixed code:
def sub():
    N, Hs = [input() for _ in range(2)]
    Hs = [int(e) for e in Hs.split(" ")]
    count = 1
    maxH = Hs[0]
    for i in range(1, int(N)):
        h = Hs[i]
        if h >= maxH:
            count = count + 1
            maxH = h


    print("{}".format(count))

sub()