Buggy python submission (verdict: Time Limit Exceeded):
N=int(input().split(" ")[0])
put=input().split(" ")
A=[]
for i in range(N):
    A.append(int(put[i]))

p=[A[0]]
for i in range(1,N-1):
    if A[i-1]<A[i] and A[i]>A[i+1]:
        p.append(A[i])
    elif A[i-1]>A[i] and A[i]<A[i+1]:
        p.append(A[i])

p.append(A[N-1])

x=0
t=1
for i in range(len(p)):
    k=i+1
    y=0
    while k<=(len(p)-1):
        if y< p[k]-p[i]:
            y=p[k]-p[i]
        k+=1
    if x<y:
        x=y
        t=1
    elif x==y:
        t=t+1

print(t)        

Fixed submission:
nt=input().split(" ")
N=int(nt[0])
T=int(nt[1])


a=input().split(" ")
int_a=[]
maxlist=[]
for i in range(N):
    int_a.append(int(a[i]))

reva=int_a
reva.reverse()
max=0
for i in range(N):
    if reva[i]>max:
        max=reva[i]
    maxlist.append(max)

maxlist.reverse()
int_a.reverse()


max=0
count=1
for i in range(N):
    if maxlist[i]-int_a[i]>max:
        count=1
        max=maxlist[i]-int_a[i]
    elif maxlist[i]-int_a[i]==max:
        count+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input().split(" ")[0])
A=input().split(" ")
x=0
t=1
for i in range(N):
    k=i+1
    y=0
    while k<=N-1:
        if y< int(A[k])-int(A[i]):
            y=int(A[k])-int(A[i])
        k+=1
    if x<y:
        x=y
        t=1
    elif x==y:
        t=t+1

print(t)        
        




Fixed submission:
nt=input().split(" ")
N=int(nt[0])
T=int(nt[1])


a=input().split(" ")
int_a=[]
maxlist=[]
for i in range(N):
    int_a.append(int(a[i]))

reva=int_a
reva.reverse()
max=0
for i in range(N):
    if reva[i]>max:
        max=reva[i]
    maxlist.append(max)

maxlist.reverse()
int_a.reverse()


max=0
count=1
for i in range(N):
    if maxlist[i]-int_a[i]>max:
        count=1
        max=maxlist[i]-int_a[i]
    elif maxlist[i]-int_a[i]==max:
        count+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input().split(" ")[0])
A=input().split(" ")
x=[]
for i in range(N):
    k=i+1
    y=0
    while k<=N-1:
        if y< int(A[k])-int(A[i]):
            y=int(A[k])-int(A[i])
        k+=1
    if y!=0:    
        x.append(y)


print(x.count(max(x)))


Fixed submission:
nt=input().split(" ")
N=int(nt[0])
T=int(nt[1])


a=input().split(" ")
int_a=[]
maxlist=[]
for i in range(N):
    int_a.append(int(a[i]))

reva=int_a
reva.reverse()
max=0
for i in range(N):
    if reva[i]>max:
        max=reva[i]
    maxlist.append(max)

maxlist.reverse()
int_a.reverse()


max=0
count=1
for i in range(N):
    if maxlist[i]-int_a[i]>max:
        count=1
        max=maxlist[i]-int_a[i]
    elif maxlist[i]-int_a[i]==max:
        count+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input().split(" ")[0])
A=input().split(" ")
x=[]
for i in range(N):
    k=i+1
    y=0
    while k<=N-1:
        if y< int(A[k])-int(A[i]):
            y=int(A[k])-int(A[i])
        k+=1
    if y!=0:    
        x.append(y)


print(x.count(max(x)))


Fixed submission:
nt=input().split(" ")
N=int(nt[0])
T=int(nt[1])


a=input().split(" ")
int_a=[]
maxlist=[]
for i in range(N):
    int_a.append(int(a[i]))

reva=int_a
reva.reverse()
max=0
for i in range(N):
    if reva[i]>max:
        max=reva[i]
    maxlist.append(max)

maxlist.reverse()
int_a.reverse()


max=0
count=1
for i in range(N):
    if maxlist[i]-int_a[i]>max:
        count=1
        max=maxlist[i]-int_a[i]
    elif maxlist[i]-int_a[i]==max:
        count+=1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input().split(" ")[0])
A=input().split(" ")
x=[]
for i in range(N):
    k=i+1
    y=0
    while k<=N-1:
        if y< int(A[k])-int(A[i]):
            y=int(A[k])-int(A[i])
        k+=1
    if y!=0:    
        x.append(y)

x.sort()

print(x.count(x[-1]))


Fixed submission:
nt=input().split(" ")
N=int(nt[0])
T=int(nt[1])


a=input().split(" ")
int_a=[]
maxlist=[]
for i in range(N):
    int_a.append(int(a[i]))

reva=int_a
reva.reverse()
max=0
for i in range(N):
    if reva[i]>max:
        max=reva[i]
    maxlist.append(max)

maxlist.reverse()
int_a.reverse()


max=0
count=1
for i in range(N):
    if maxlist[i]-int_a[i]>max:
        count=1
        max=maxlist[i]-int_a[i]
    elif maxlist[i]-int_a[i]==max:
        count+=1

print(count)