qyliang/CodeNanoFix huggingface dataset:
Buggy code:
a = int(input())
l = list(map(int, input().split()))
for i in range(a):
  if l[i] >= max(l[0:i]):
    c +=1
print(c)

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

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

Fixed code:
n=int(input())
a=list(map(int,input().split()))
sum=1
temp=a[0]
for i in range(n-1):
  if temp<=a[i+1]:
    temp=a[i+1]
    sum+=1
print(sum)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
count = 1
ma = H[0]
for i in range(N):
  if H[i]>ma:
    ma = H[i]
    count+=1
print(count)

Fixed code:
N = int(input())
H = list(map(int,input().split()))
count = 0
ma = H[0]
for i in range(N):
  if H[i]>=ma:
    ma = H[i]
    count+=1
print(count)
Buggy code:
N = int(input())
H = list(map(int,input().split()))
count = 1
for i in range(1,N):
  judge = 0
  for j in range(i):
    if(H[j]>H[I]):
      judge = judge +1
      break
  if(judge==0):
    count=count+1
print(count)
  
  
  
  

Fixed code:
N = int(input())
H = list(map(int,input().split()))
count = 1
for i in range(1,N):
  judge = 0
  for j in range(i):
    if(H[j]>H[i]):
      judge = judge +1
      break
  if(judge==0):
    count=count+1
print(count)
Buggy code:
n = int(input())
data = list(map(int, input().split()))

ans = 1
max_ = data[0]
for i in range(1, n-1):
    if max_ <= data[i]:
        max_ = data[i]
        ans += 1

print(ans)


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

ans = 1
max_ = data[0]
for i in range(1, n):
    if max_ <= data[i]:
        max_ = data[i]
        ans += 1

print(ans)
Buggy code:
N=int(input())
H=list(map(int,input().split()))
count=1
for i in range(N):
    for j in range(i):
        if H[i]<H[j]:
            break
        count+=1
print(count)

Fixed code:
N=int(input())
H=list(map(int,input().split()))
count=0
flag=1
for i in range(N):
    flag=1
    for j in range(i):
        if H[i]<H[j]:
            flag=0
            break
    if flag==1:
        count+=1
print(count)
Buggy code:
N=int(input())
H=[int(i) for i in input().split()]
hotel=0
for i in range(N):
    count=0
    for k in range(i):
        if H[k]<=H[i]:
            count+=1
        continue
            
    if count==i:5
        hotel+=1


print(hotel)

Fixed code:
N=int(input())
H=[int(i) for i in input().split()]
hotel=0
for i in range(N):
    count=0
    for k in range(i):
        if H[k]<=H[i]:
            count+=1
        continue
            
    if count==i:
        hotel+=1


print(hotel)
Buggy code:
N = int(input())
H = list(map(int, input().split()))
sum = 0
for i in range(N):
    h = [H[j] for j in range(i+1)]
    if i == 0:
        sum += 1
        continue
    if H[i] == max(h):
        sum += 1
    print(h, H[i])
print(sum)

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

count = 1
max = 0
for i in range(n-1):
    if max < h[i]:
        max = h[i]

    print(max)
    if max <= h[i+1]:
        count += 1

print(count)


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

count = 1
max = 0
for i in range(n-1):
    if max < h[i]:
        max = h[i]

    if max <= h[i+1]:
        count += 1

print(count)
Buggy code:
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(N):
    for j in H[:i]:
        if j < H[i]:
            pass
        else:
            break
    else:
        ans += 1
print(ans)

Fixed code:
N = int(input())
H = list(map(int, input().split()))
ans = 0
for i in range(N):
    for j in H[:i]:
        if j <= H[i]:
            pass
        else:
            break
    else:
        ans += 1
print(ans)
Buggy code:
N = input()
mt_lst = list(map(int, input().split()))
cnt = 0

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


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

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

print(cnt)
Buggy code:
import numpy as np
N = int(input())
H = map(int, input().split())

tmp = []
for i in range(1, len(H)):
    tmp.append(all(H[:i]<=H[i]))
print(sum(tmp)+1)

Fixed code:
import numpy as np
N = int(input())
H = np.array(list(map(int, input().split())))
tmp = []
for i in range(1, len(H)):
    tmp.append(all(H[:i]<=H[i]))
print(sum(tmp)+1)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
total = 0

for i in range(1, n):
    no_flag = 0
    for j in range(i-1):
        if h[j] > h[i]:
            no_flag = 1
        else:
            pass
    if no_flag == 0:
        total += 1

print(total)

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

for i in range(1, n):
    no_flag = 0
    for j in range(i):
        if h[j] > h[i]:
            no_flag = 1
        else:
            pass
    if no_flag == 0:
        total += 1

print(total)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
max_h = 0
ans = 0
for a in h:
  if max <= a:
    ans += 1
  max_h = max(a, max_h)
  
print(ans)

Fixed code:
n = int(input())
h = list(map(int, input().split()))
max_h = 0
ans = 0
for a in h:
  if max_h <= a:
    ans += 1
  max_h = max(a, max_h)
  
print(ans)
Buggy code:
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N):
  c += 1
  if b < a[c] and a[c - 1]  <a[c] :
    ans += 1
print(ans + 1) 

Fixed code:
N = int(input())
a = [int(i) for i in input().split()]
b = a[0]
c = 0
ans = 0
for i in range(N-1):
  c += 1
  if b <= a[c] :
    b = a[c]
    ans += 1
print(ans + 1)
Buggy code:
a = [int(i) for i in input().split()]
h = a[1:]
num = 1
for i in range(1,len(h)):
    if h[i] >= max(h[:i]):
        num += 1

print(num)

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

num = 1
for i in range(1,len(h)):
    if h[i] >= max(h[:i]):
        num += 1

print(num)
Buggy code:
n = int(input())
h = [int(i) for i in input().split()]
maxh,c = 0,0
for i in h:
  if i >= maxh:
    c += 1
print(c)
    



Fixed code:
n = int(input())
h = [int(i) for i in input().split()]
maxh,c = 0,0
for i in h:
  maxh = max(maxh,i)
  if i >= maxh:
    c += 1
    
print(c)
Buggy code:
n=int(input())
h=list(map(int,input().split()))
ans=0
tmp=h[0]
for i in range(len(h)-1):
    if tmp<=h[i]:
        ans+=1
        tmp=h[i]
print(ans)

Fixed code:
n=int(input())
h=list(map(int,input().split()))
ans=0
tmp=h[0]
for i in range(len(h)):
    if tmp<=h[i]:
        ans+=1
        tmp=h[i]
print(ans)
Buggy code:
n=int(input())
h = list(map(int,input().split()))
 
ans=1
cnt=0
for i in range(n-1):
  for j in range(i+1):
    if h[j]<=h[i+1]:
      cnt+=1
    else:
      break
    if cnt==i:
      ans+=1
      cnt=0
 
print(ans)

Fixed code:
n=int(input())
h = list(map(int,input().split()))
 
ans=1
cnt=0
for i in range(n-1):
  for j in range(i+1):
    if h[j]<=h[i+1]:
      cnt+=1
    else:
      cnt=0
      break
    if cnt==i+1:
      ans+=1
      cnt=0
      break
 
print(ans)
Buggy code:
c=int(input())
n=list(map(int, input().split()))

ans = 0
for i in n:
  if n[0] <= i:
    ans += 1
print(ans)

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

ans = 0
max = n[0]
for i in n:
  if max <= i:
    ans += 1
    max = i
print(ans)
Buggy code:
n = int(input())
s = list(map(int,input().split()))
cnt = 1
for i in range(n-1,0,-1):
    result = True
    for j in range(i-2,-1,-1):
        if s[j] > s[i]:
            result = False
            break
    if result:
        cnt +=1
print(cnt)

Fixed code:
n = int(input())
s = list(map(int,input().split()))
cnt = 1
for i in range(n-1,0,-1):
    result = True
    for j in range(i-1,-1,-1):
        if s[j] > s[i]:
            result = False
            break
    if result:
        cnt +=1
print(cnt)
Buggy code:
n = int(input())
l = list(map(int, input().split()))
c = 1

bean = True
for i in range(1, n):
  bean = True
  for j in range(i, 0, i-1):
    if l[j-1] > l[i]:
      bean = False
  if bean:
    c += 1

print(c)


Fixed code:
n = int(input())
l = list(map(int, input().split()))
c = 1

bean = True
for i in range(1, n):
  bean = True
  for j in range(i, 0, -1):
    if l[j-1] > l[i]:
      bean = False
  if bean:
    c += 1

print(c)
Buggy code:
N = int(input())
H = list(map(int, input().split(" ")))
for i in range(N):
    if i==0:
        cnt+=1
    else:
        h=H[i]
        c=0
        for j in range(i):
            if H[j]>h:
                c=1
        if c==0:
            cnt+=1
print(cnt)


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

Fixed code:
N = input()
N = int(N)
str = input().split()
H = []
i = 0
j = 0
for i in range(N):
  H.append( int(str[i]) )
flag = 0
ans = 0
for i in range(N):
  for j in range(i):
    if H [i] < H[j]:
      flag =  1
      break
    else:
      flag = 0
  if flag == 0:
    ans = ans+1
  flag = 0

print(ans)
Buggy code:
n = input()
l = list(input.split())

cnt = 0
max_height = 0
for i in range(len(l)):
  if l[i] > max_height:
    cnt +=1
    max_height = l[i]
    
print(cnt)   
  

Fixed code:
n = input()
l = list(input().split())
 
cnt = 0
max_height = 0
for i in range(len(l)):
  if int(l[i]) >= int(max_height):
    cnt +=1
    max_height = l[i]
    
print(cnt)
Buggy code:
N = int(input())
H = list(map(int, input().split())
ans = 1
height = H[0]
for i in range(1, N+1):
    if H[i] >= height:
        ans += 1
        height = H[i]

print(ans)

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

print(ans)
Buggy code:
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N-1):
    for k in range(i+1):
        out = False
        if k >= 0:
            print(ListH[k],ListH[i])
            if ListH[k] < ListH[i]:
                out = True
            if not out :
                result += 1
print(result)

Fixed code:
N = int(input())
ListH = list(map(int,input().split()))
result = 0
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)
Buggy code:
def solve(string):
    n, *h = map(int, string.split())
    count = 1
    for i in range(1, n):
        if max(h[:i]) <= h[i]:
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve(input()))


Fixed code:
def solve(string):
    n, *h = map(int, string.split())
    count = 1
    for i in range(1, n):
        if max(h[:i]) <= h[i]:
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))
Buggy code:
N = int(input())
hotel = list(map(int, input().split()))
count = 0
for i in range(1, N):
  for j in range(i):
    if all(hotel[i] >= hotel[j]):
      count += 1
print(count+1)


Fixed code:
N = int(input())
hotel = list(map(int, input().split()))
count = 0
c = 0
for i in range(1, N):
    c=0
    for j in range(0, i):
        
        if hotel[i] >= hotel[j]:
            c += 1
        if c == i:
            count += 1
print(count+1)
Buggy code:
l = []
n = int(input())
l = [int(i) for i in input().split()] 
ok = 0

print(l)
for i in range(1,n):
	for j in range(i):
		if l[i] >= l[j]:
			if i -1 == j:
				ok += 1
			
		else:
			break

print(ok + 1)

Fixed code:
l = []
n = int(input())
l = [int(i) for i in input().split()] 
ok = 0

for i in range(1,n):
	for j in range(i):
		if l[i] >= l[j]:
			if i -1 == j:
				ok += 1
			
		else:
			break

print(ok + 1)
Buggy code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 1:
    num+= 1
    continue
  for B in range(A + 1):
    if (H[A]) < (H[B]):
      tf = 0
  if tf:
    num += 1
print("{}".format(num))


Fixed code:
N = int(input())
H = list(input().split())
num = 0
for A in range(N):
  tf = 1
  if A == 0:
    num+= 1
    continue
  for B in range(A + 1):
    if int(H[A]) < int(H[B]):
      tf = 0
  if tf:
    num += 1
print("{}".format(num))
Buggy code:
input()
lis = list(map(int, input().split()))
print(len([n for i, n in enumerate(lis[1:]) if n >= max(lis[:i + 1])]) + 1

Fixed code:
input()
lis = list(map(int, input().split()))
print(len([n for i, n in enumerate(lis[1:]) if n >= max(lis[:i + 1])]) + 1)
Buggy code:
N = int(input())
l = list(map(int, input().split()))

th = 0
ans = 0
for x in l:
  if x >= th:
    ans += 1
  th = x
print(ans)

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

th = 0
ans = 0
for x in l:
  if x >= th:
    ans += 1
    th = x
print(ans)
Buggy code:
N = int(input())
H = []*100
H[:] = map(int, input().split())
ct = 1
for i in range(N-1):
    max = max(H[:i+1])
    if H[i+1] >= max:
        ct += 1
print(ct)

Fixed code:
N = int(input())
H = []*100
H[:] = map(int, input().split())
ct = 1
for i in range(N-1):
    maxim = max(H[:i+1])
    if H[i+1] >= maxim:
        ct += 1
print(ct)
Buggy code:
n=int(input())
h=list(map(int,input().split()))
a=1

for i in range(1,n):
    print(h[i])
    print('----------')
    for j in range(i):
        print(h[j])
        print('---')
        if h[i]<h[j]:break
        elif j==i-1:
            a+=1

print(a)

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

for i in range(1,n):
    for j in range(i):
        if h[i]<h[j]:break
        elif j==i-1:
            a+=1

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

print(counter)

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

print(counter)
Buggy code:
import sys

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

ans = 1
mx = line[0]


for i in range(1,line.index(max(line))):
	if line[i] >= mx:
		ans += 1
		mx = line[i]
ans += 1
print(ans)


Fixed code:
import sys

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

ans = 1
mx = line[0]


for i in range(1,line.index(max(line))):
	if line[i] >= mx:
		ans += 1
		mx = line[i]

for i in range(line.index(max(line)),len(line)):
	if i != 0 and line[i] == max(line):
		ans += 1

print(ans)
Buggy code:
n=int(input())
l=list(map(int,input().split()))
max_value=-999
cnt=0
for i in range(n):
  if max_balue<l[i]:
    cnt+=1
print(cnt)

Fixed code:
n=int(input())
l=list(map(int,input().split()))
max_value=-999
cnt=0
for i in range(n):
  if max_value<=l[i]:
    max_value=max(max_value,l[i])
    cnt+=1
print(cnt)
Buggy code:
n=int(input())
l=list(map(int,input().split()))
cnt=1
max_h=-1
for i in range(n):
  max_h=max(l[i],max_h)
  if l[i+1]>=max_h:
    cnt+=1
print(cnt)

Fixed code:
n=int(input())
l=list(map(int,input().split()))
cnt=1
max_h=-1
for i in range(n-1):
  max_h=max(l[i],max_h)
  if l[i+1]>=max_h:
    cnt+=1
print(cnt)
Buggy code:
N = int(input())
l = list(map(int, input().split()))
counter=0
for i in range(N):
  if max(l[:i+1])==l[i]
   counter += 1
print(counter)

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


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

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

print(ans)


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

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

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

Fixed code:
s = int(input())
List=list(map(int,input().split()))
a = 0
b=List[0]
for i in range(s):
    if b <= List[i]:
        a +=1
        b = List[i]

print(a)
Buggy code:
a = int(input())
h = list(map(int, input().split()))
count = 1


for i in range(1, len(h)):
    for m in range(0,i):
        if h[i] < h[m]:
            break
        if m == i - 2:
            count += 1

print(count)


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


for i in range(1, len(h)):
    for m in range(0,i):
        if h[i] < h[m]:
            break
        if m == i - 1:
            count += 1

print(count)
Buggy code:
n = int(input())
h = [int(x) for x in input().split()]
c = 0
for i in range(n):
    if h[i] >= max(h[:i]):
        c += 1
print(c)


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

for i in range(1, n):
    if h[i] >= max(h[:i]):
        c += 1
print(c)
Buggy code:
n = int(input())
h = list(map(int, input().split()))
print(h)
a=1
flag=False
for j in range(0,n):
    for i in range(0,j):
        if h[i] <= h[j]:
            flag=True
        else:
            break
    if flag:
        a = a + 1
        flag=False

print(a)

Fixed code:
n = int(input())
h = list(map(int, input().split()))
a = 1
for j in range(1, n):
    flag=False
    for i in range(0, j):
        if h[i] <= h[j]:
            flag = True
        else:
            flag = False
            break
    if flag:
        a = a + 1

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

count = 0
maximum = 0

for i in range(N):
	H[i] > maximum
	count += 1
	maximum = H[i]		

print(count)




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

count = 0
maximum = 0

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

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

Fixed code:
n = int(input())
data = list(map(int,input().split()))
h = 0
ans = 0
for i in range(n):
	if data[i]>=h:
		ans+=1
		h = data[i]
print(ans);
Buggy code:
N = int(input())
H = list(map(int, input().split()))
result = 1
 
for i in range(N):
    dec = True
    for j in range(i):
        if H[i] <= H[j]:
            dec = False
            break
    if dec == True:
        result += 1
print(result)

Fixed code:
N = int(input())
H = list(map(int, input().split()))
result = 1
 
for i in range(1, N):
    dec = True
    for j in range(i):
        if H[i] < H[j]:
            dec = False
            break
    if dec == True:
        result += 1
print(result)
Buggy code:
n = int(input())
ls = [int(i) for i in input().split()]
maxx = ls[0]
inns = 0
for i in range(len(ls)):
    if ls[i] >= maxx:
        inns += 1
    if ls[i] > maxx:
        maxx += ls[i]

print(inns)



Fixed code:
n = int(input())
ls = [int(i) for i in input().split()]
maxx = ls[0]
inns = 0
for i in range(len(ls)):
    if ls[i] >= maxx:
        inns += 1
    if ls[i] > maxx:
        maxx =  ls[i]

print(inns)
Buggy code:
n=int(input())
s=list(map(int,input().split()))
c=1
sm=s[0]
for i in range(n-1):
  if sm < s[i+1]:
    sm = s[i+1]
    c += 1
print(c)

Fixed code:
n=int(input())
s=list(map(int,input().split()))
c=1
sm=s[0]
for i in range(n-1):
  if sm <= s[i+1]:
    sm = s[i+1]
    c += 1
print(c)
Buggy code:
N = int(input())
l = list(map(int,input().split()))

cnt = max = 0
for i in range(N):
    if l[i] > max:
        max = l[i]
        cnt += 1

print(cnt)

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

cnt = max = 0
for i in range(N):
    if l[i] >= max:
        max = l[i]
        cnt += 1

print(cnt)
Buggy code:
N = int(input())
H = list(input().split())
h = [int(s) for s in H]
n = 1
for i in range(1, N):
    if h[i] == h[0:i+1]:
        n = n+1
print(n)

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

max_H = H[0]
L = [1 for i in range(N)]
for i in range(1, N):
    if H[i] > max_H:
        L[i] = 1
    else:
        L[i] = 0
    max_H = max(H[i], max_H)

print(sum(L))


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

max_H = H[0]
L = [1 for i in range(N)]
for i in range(1, N):
    if H[i] >= max_H:
        L[i] = 1
    else:
        L[i] = 0
    max_H = max(H[i], max_H)

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

count = 0

High = H[0]

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

print(count)


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

count = 0

High = H[0]

for i in range(N):
	if H[i] >= High:
		count += 1
		High = H[i]
		

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

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

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

first = H[0]
ret = 0
for it in H:
    if it >= first:
        ret += 1
print(ret)

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

first = H[0]
ret = 0
for it in H:
    if it >= first:
        ret += 1
        first = it
print(ret)
Buggy code:
 N=int(input())
List=list(map(int,input().split()))
count=1
for i in range(1,N):
    for j in range(i):
        w=0
        if List[j]>List[i]:
            w+=1
    if w==0:  
        count+=1
print(count)
   
    

Fixed code:
N=int(input())
List=list(map(int,input().split()))
count=1

for i in range(1,N):
    W=0
    for j in range(i):
        if List[j]>List[i]:
            W+=1
    if W==0:  
        count+=1
print(count)
Buggy code:
n = int(input())
h = list(map(int,input().split()))
a=[h[i+1] for i in range(n-1) if h[i] >= max(h[i:])]
print(len([i for i in a])+1)

Fixed code:
n = int(input())
h = list(map(int,input().split()))
print(len([h[i] for i in range(n) if h[i] >= max(h[:i+1])]))