Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0


for i in range(1,n):
    if not boon and l[i] == l[i-1]:
        c += 1
        boon = True
    else:
        boon = False

print(c)


Fixed submission:
n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0

i = 0
while i+1 < n:
    if l[i] == l[i+1]:
        c += 1
        i += 2
    else:
        i += 1
print(c)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0
i = 0
def s():
    while i+2 < len(l):
        if l[i] == l[i+1]:
            if l[i+1] == l[i+2]:
                c += 1
                i += 2
            else:
                c += 1
                i += 2
        else:
            i += 1
    
    print(c)
    return 0

s()

Fixed submission:
n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0

i = 0
while i+1 < n:
    if l[i] == l[i+1]:
        c += 1
        i += 2
    else:
        i += 1
print(c)
Buggy python submission (verdict: Runtime Error):
a = input()

if a == "ABC":
    print("ARC")
else a == "ARC":
    print("ABC")

Fixed submission:
a = input()

if a == "ABC":
    print("ARC")
elif a == "ARC":
    print("ABC")
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, k=map(int, input().split())

pp = []
for i in range(2*k):
    pp.append(list(input().split()))

p = pp[1::2]
s = 0
l = []

for i in range(k):
    q = p[i]
    
    l.extend(q)

ll = set(l)

print(n - len(ll))


Fixed submission:
import numpy as np
n, k=map(int, input().split())

pp = []
for i in range(2*k):
    pp.append(list(input().split()))

p = pp[1::2]
s = 0
l = []

for i in range(k):
    q = p[i]
    l.extend(q)


ll = set(l)

print(n - len(ll))
Buggy python submission (verdict: Time Limit Exceeded):
import math

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

c = a/b
p = []

for x in range(n + 1):
    d = math.floor(c * x) - a * math.floor(x / b)
    p.append(d)
    p.sort()
    if len(p) == 2:
        del p[0]


print(p[0])


Fixed submission:
import sys
input = sys.stdin.readline

import math

def main():
    a,b,n = map(int, input().split())

    if b > n:
        print(math.floor(a*n/b))

    else:
        print(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import math

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

c = a/b
p = []

for x in range(n + 1):
    d = math.floor(c * x) - a * math.floor(x / b)
    p.append(d)

p.sort()
print(p[n])


Fixed submission:
import sys
input = sys.stdin.readline

import math

def main():
    a,b,n = map(int, input().split())

    if b > n:
        print(math.floor(a*n/b))

    else:
        print(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
vv = list(input())

ccc = "7" in vv

if ccc = True:
    print("Yes")
else:
    print("No")


Fixed submission:
vv = int(input())

if vv <= 999 and vv >= 100:
    vvvv = list(str(vv))


    ccc = "7" in vvvv

    if ccc == True:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Runtime Error):

vv = list(input())

ccc = "7" in vv

if ccc = True:
    print("Yes")
else:
    print("No")


Fixed submission:
vv = int(input())

if vv <= 999 and vv >= 100:
    vvvv = list(str(vv))


    ccc = "7" in vvvv

    if ccc == True:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
X, A = map(int,input.sprit())


if X > A:
  print("10")
  else:
    print("0")

Fixed submission:

X, A = map(int,input().split())


if X < A:
    print("0")
else:
    print("10")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

c = int(a)
d = int(b) 

time = (1/c) * d

return(time)

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

c = int(a)
d = int(b)

time = c / d

print(time)
Buggy python submission (verdict: Runtime Error):
print "Yes" if '7' in raw_input() else "No"

Fixed submission:
print "Yes" if '7' in raw_input() else "No"

Buggy python submission (verdict: Runtime Error):
print "Yes" if '7' in raw_input() else "No"

Fixed submission:
print "Yes" if '7' in raw_input() else "No"
Buggy python submission (verdict: Runtime Error):
a, b = raw_input().split()
Z = [a * b, b * a]
print sorted(Z)[0]

Fixed submission:
a, b = raw_input().split()
Z = [a * int(b), b * int(a)]
print sorted(Z)[0]
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split()):

S = 1
ans = 0
while S < B:
	S += A - 1
	ans += 1
print (ans)

Fixed submission:
A, B = map(int, input().split())

S = 1
ans = 0
while S < B:
	S += A - 1
	ans += 1
print (ans)
Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
pts = [map(int, raw_input().split()) for i in xrange(n)]

for i in xrange(105):
    for j in xrange(105):
        H = -7
        ok = True
        for k in pts:
            if max(H - abs(k[0] - i) - abs(k[1] - j), 0) == k[2]:
                continue
            elif H < 1:
                H = k[2] + abs(k[0] - i) + abs(k[1] - j)
            else:
                ok = False
        if ok:
            print i, j, max(H, 1)
            exit(0)

Fixed submission:
n = int(raw_input())
if n == 1:
    print "Hello World"
else:
    print int(raw_input()) + int(raw_input())

Buggy python submission (verdict: Runtime Error):
n, m = map(int, raw_input().split())

target = m / n

while True:
    if (m - target * n) % target == 0:
        print target
        exit(0)
    target -= 1

Fixed submission:
n = int(raw_input())
if n == 1:
    print "Hello World"
else:
    print int(raw_input()) + int(raw_input())
Buggy python submission (verdict: Time Limit Exceeded):
inputs = [int(x) for x in input().split()]
sumAns = 0

while(inputs[3] > 0):
	if inputs[0] > 0:
		sumAns = sumAns + 1
		inputs[0] = inputs[0] - 1
		inputs[3] = inputs[3] - 1
	elif inputs[1] > 0:
		inputs[1] = inputs[1] - 1
		inputs[3] = inputs[3] - 1
	elif inputs[2] > 0:
		sumAns = sumAns - 1
		inputs[2] = inputs[2] -1
		inputs[3] = inputs[3] - 1
print(sumAns)

Fixed submission:
inputs = [int(x) for x in input().split()]
sumAns = 0

if inputs[0] > inputs[3]:
	sumAns = sumAns + inputs[3]
	inputs[3] = 0
else:
	sumAns = sumAns + inputs[0]
	inputs[3] = inputs[3] - inputs[0]

if inputs[1] > inputs[3]:
	inputs[3] = 0
else:
	inputs[3] = inputs[3] - inputs[1]

if inputs[2] > inputs[3]:
	sumAns = sumAns - inputs[3]
	inputs[3] = 0
else:
	sumAns = sumAns - inputs[3]
	inputs[3] = inputs[3] - inputs[2]

print(sumAns)
Buggy python submission (verdict: Runtime Error):
 s, w = (int(x) for x in input().split())
if s <= w:
    print('unsafe')
else:
    print('safe')

Fixed submission:
s, w = map(int, input().split())
if s <= w:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = n // 100
b = n % 100 // 10
c = n % 10
if a = 7:
  print('Yes')
elif b = 7:
  print('Yes')
elif c = 7:
  print('Yes')
else:
  print('No')

Fixed submission:
n = str(input())
a = '7'
if a in n:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A= list(int(input().split(' ')))
if A.count(5) == 2 and A.coutn(7) == 1:
  print('YES')
else:
  print('NO')


Fixed submission:
A= list(map(int, input().split()))
if A.count(5) == 2 and A.count(7) == 1:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
if K >= One:
    print(One)
elif 0 < K < One:
    print(K)

Fixed submission:

A, B, C, K = [int(x) for x in input().split()]


if A >= K:
    print(K)
elif A + B >= K:
    print(A)
else:
    lack = K - A - B
    print(A - lack)
Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
h = [int(x) for x in input().split(" ")]


cnt = 0
for i in range(1, N):
    left = 0
    right = i
    while(right < N):
        if h[right] + h[left] == i:
            cnt += 1
            #print((left, right))
        left += 1
        right += 1
print(cnt)



Fixed submission:
from collections import Counter

N = int(input())
h = [int(x) for x in input().split(" ")]
 
L = [0] * N
R = [0] * N
cnt = 0
for i in range(0, N):
    L[i] = i + 1 + h[i]
    R[i] = i + 1- h[i]
LC = Counter(L)
RC = Counter(R)

cnt = 0
for key,values in LC.most_common():
    if key in RC:
        num = RC[key]
        cnt += values * num

print(cnt)
Buggy python submission (verdict: Runtime Error):
#ABC164 B
p = [int(x) for x in input().split()]

takahashi_turn = True
while (p[0]<=0) or (p[2]<=0):
    if takahashi_turn:
        p[2] = p[2] - p[1]
    else:
        p[0] = p[0] - p[3]
    takahashi_turn = ! takahashi_turn

if p[0] > 0:
    print("Yes")
else:
    print("No")

Fixed submission:
#ABC164 B
p = [int(x) for x in input().split()]

takahashi_turn = True
while (p[0]>0) and (p[2]>0):
    if takahashi_turn:
        p[2] = p[2] - p[1]
    else:
        p[0] = p[0] - p[3]
    takahashi_turn = not takahashi_turn

if p[0] > 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
#ABC164 B
p = [int(x) for x in input().split()]

takahashi_turn = True
while (p[0]<=0) or (p[2]<=0):
    if takahashi_turn:
        p[2] = p[2] - p[1]
    else:
        p[0] = p[0] - p[3]
    takahashi_turn = ! takahashi_turn

if p[0] > 0:
    print("Yes")
else:
    print("No")

Fixed submission:
#ABC164 B
p = [int(x) for x in input().split()]

takahashi_turn = True
while (p[0]>0) and (p[2]>0):
    if takahashi_turn:
        p[2] = p[2] - p[1]
    else:
        p[0] = p[0] - p[3]
    takahashi_turn = not takahashi_turn

if p[0] > 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,K=map(int,input().split())
ans=0
if K >= A:
    ans+=A
    K-=A
    A=0
while K > 0 and A > 0:
    ans+=1
    K-=1
    A-=1
if K >= B:
    K-=B
    B=0
while K > 0 and B > 0:
    K-=1
    B-=1
if K >= C:
    ans-=C
    K-=C
    C=0
while K > 0 and C > 0:
    ans-=1
    K-=1
    C-=1
print(ans)

Fixed submission:
A,B,C,K=map(int,input().split())
ans=0
if K >= A:
    ans+=A
    K-=A
    A=0
else:
    ans=K*1
    K=0
if K >= B:
    K-=B
    B=0
else:
    K=0
if K >= C:
    ans-=C
    K-=C
    C=0
else:
    ans=ans+K*(-1)
    C=0
print(ans)
Buggy python submission (verdict: Runtime Error):
P=int(input())
X=list(map(int,input().split()))
l=[]
for j in range(min(X),max(X)):
    ans = [(i-j)**2 for i in X ]
    l.append(sum(ans))
print(min(l))


Fixed submission:
P=int(input())
X=list(map(int,input().split()))
l=[]
for j in range(min(X),max(X)+1):
    ans = [(i-j)**2 for i in X ]
    l.append(sum(ans))
print(min(l))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(1,n+1)
    if l[i-1]!=i:
        count+=1
print("YES" if count==0 or count==2 else "NO")

Fixed submission:
a,b=map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(1,6):
    if l[i-1]!=i:
        count+=1
print("YES" if count==0 or count==2 else "NO")

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(1,n+1):
    if l[i-1]!=i:
        count+=1
print("YES" if count==0 or count==2 else "NO")
Buggy python submission (verdict: Runtime Error):
# AGCT -> 0123
# 条件
# # 文字 0-3のみ
# # 文字 0-2を含まない
# # 隣同士swapしても0-2を含まない
# 012, 102, 021, 0?12, 01?2が含まずに条件を満たす文字列 Sの数を求める

# S + 0
# S + 1 -> 021の可能性
# S + 2 -> 0?12, 01?2の可能性
# S + 3
# Sの手前3文字を見れば良い -> DP
# # DP: 動的計画法, 計算をまとめるだけのテクニック
# # 文字数, 最後から3文字目, 2文字目, 1文字目の情報をもつDP

# ACが来たらカウントする

import numpy as np

N = int(input())

mod = 10 ** 9 + 7
# メモ化: [{}, {}, {}, {}]
memo = np.zeros((N + 1, 4, 4, 4))
memo[0][3][3][3] = 1

# 文字列の文字数
for c in range(N):
    # 最後から1文字目の文字
    for i in range(4):
        # 最後から2文字目の文字
        for j in range(4):
            # 最後から3文字目の文字
            for k in range(4):
                # 新しく追加する文字
                for a in range(4):
                    # ダメな5つの条件をカットする
                    # 012, 102, 021, 0?12, 01?2
                    if a == 1 and i == 2 and j == 0:
                        continue
                    if a == 2 and i == 1 and j == 0:
                        continue
                    if a == 2 and i == 0 and j == 1:
                        continue
                    if a == 2 and j == 1 and k == 0:
                        continue
                    if a == 2 and i == 1 and k == 0:
                        continue
                    # ダメな条件を抜けたら，aを足した文字列を作れる
                    memo[c + 1][a][i][j] += memo[c][i][j][k]
                    memo[c + 1][a][i][j] %= mod

# 長さNの全部の答えをまとめる処理
ans = 0
# 最後から1文字目の文字
for i in range(4):
    # 最後から2文字目の文字
    for j in range(4):
        # 最後から3文字目の文字
        for k in range(4):
            ans += memo[N][i][j][k]
            ans %= mod
print(int(ans))


Fixed submission:
b = input()

if b == "A":
    result = "T"
elif b == "C":
    result = "G"
elif b == "G":
    result = "C"
elif b == "T":
    result = "A"

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = list(map(int, input().split()))
S = input()
target = "AC"

input_list = []
for i in range(Q):
    l, r = list(map(int, input().split()))
    print(S[l - 1 : r].count(target))


Fixed submission:
from itertools import accumulate

N, Q = list(map(int, input().split()))
S = input()
target = "AC"

# ACが来たらカウントする
dp = [0] * N
for i in range(1, N):
    s = S[i - 1] + S[i]
    if s == "AC":
        dp[i] += 1

# 累積和
DP = list(accumulate(dp))

input_list = []
for i in range(Q):
    l, r = list(map(int, input().split()))
    print(DP[r - 1] - DP[l - 1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = list(map(int, input().split()))
S = input()
target = "AC"

input_list = []
for _ in range(Q):
    input_list.append(list(map(int, input().split())))

for i in range(Q):
    l, r = input_list[i][0], input_list[i][1]
    sub_str = S[l - 1 : r]
    print(sub_str.count(target))


Fixed submission:
from itertools import accumulate

N, Q = list(map(int, input().split()))
S = input()
target = "AC"

# ACが来たらカウントする
dp = [0] * N
for i in range(1, N):
    s = S[i - 1] + S[i]
    if s == "AC":
        dp[i] += 1

# 累積和
DP = list(accumulate(dp))

input_list = []
for i in range(Q):
    l, r = list(map(int, input().split()))
    print(DP[r - 1] - DP[l - 1])
Buggy python submission (verdict: Runtime Error):
s = str(input())

print("{}{}{}".format(s[0], len(s) - 2), s[-1])


Fixed submission:
s = str(input())

print("{}{}{}".format(s[0], len(s) - 2, s[-1]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

min_l = len(str(N))
o_min_l = min_l

for i in range(1, N):
    if N % i == 0:
        j = int(N / i)
        min_l = min(min_l, max(len(str(i)), len(str(j))))
print(min_l)


Fixed submission:
import math

N = int(input())

min_l = len(str(N))

for i in range(1, int(math.sqrt(N)) + 1):
    if N % i == 0:
        j = int(N / i)
        min_l = min(min_l, max(len(str(i)), len(str(j))))
print(min_l)
Buggy python submission (verdict: Runtime Error):
N = int(input())

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power *= i
	power %= mod
print(power)


Fixed submission:
N = int(input())

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power *= i
    power %= mod
print(power)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power *= i
power %= mod
print(power)


Fixed submission:
N = int(input())

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power *= i
    power %= mod
print(power)
Buggy python submission (verdict: Time Limit Exceeded):
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    if i > S:
        break
    # Y
    for j in range(K + 1):
        if i + j > S:
            break
        # Z
        for k in range(K + 1):
            if i + j + k > S:
                break
            if i + j + k == S:
                cnt += 1
print(cnt)


Fixed submission:
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        Z = S - i - j
        if 0 <= Z and Z <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        # Z
        for k in range(K + 1):
            if i + j + k > S:
                break
            if i + j + k == S:
                cnt += 1
print(cnt)


Fixed submission:
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        Z = S - i - j
        if 0 <= Z and Z <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        # Z
        for k in range(K + 1):
            if i + j + k > S:
                continue
            if i + j + k == S:
                cnt += 1
print(cnt)


Fixed submission:
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        Z = S - i - j
        if 0 <= Z and Z <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        # Z
        for k in range(K + 1):
            if i + j + k == S:
                cnt += 1
print(cnt)


Fixed submission:
# 0 ≦ X, Y, Z ≦ K
# X + Y + Z = S
# 2 ≦ K ≦ 2500
# 0 ≦ S ≦ 3K

K, S = list(map(int, input().split()))

cnt = 0
# X
for i in range(K + 1):
    # Y
    for j in range(K + 1):
        Z = S - i - j
        if 0 <= Z and Z <= K:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = list(map(int, input().split()))

result = [i % x for i in range(a, b + 1)].count(0)
print(result)

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

result = b // x - ~-a // x
print(result)
# result = [i % x for i in range(a, b + 1)].count(0)
# print(result)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = list(map(int, input().split()))

cnt = 0
for i in range(a, b+1):
    if i % x == 0:
         cnt += 1
print(cnt)

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

result = b // x - ~-a // x
print(result)
# result = [i % x for i in range(a, b + 1)].count(0)
# print(result)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = list(map(int, input().split()))

cnt = 0
for i in range(a, b+1):
    if i % x == 0:
         cnt += 1
print(cnt)

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

result = b // x - ~-a // x
print(result)
# result = [i % x for i in range(a, b + 1)].count(0)
# print(result)
Buggy python submission (verdict: Runtime Error):
a=input().split()
N=int(a[0])
M=int(a[1])
H=[int(x) for x in input().split()]
way=[]
for i in range(M):
    way.append([int(x) for x in input().split()])

ans=0
for i in range(N):
    con_i=[]
    for j in range(M):
        if way[j][0]==i+1:
            con_i.append(H[way[j][1]-1])
        if way[j][1]==i+1:
            con_i.append(H[way[j][0]-1])
    

    if max(con_i)<H[i]:
        ans+=1
    
print(ans)


            


Fixed submission:
a=input().split()
N=int(a[0])
M=int(a[1])
H=[int(x) for x in input().split()]
way=[]
for i in range(M):
    way.append([int(x) for x in input().split()])

dic={}
for i in range(N):
    dic[i]=set()

for h in way:
    dic[h[0]-1].add(h[1]-1)
    dic[h[1]-1].add(h[0]-1)
    

print(sum(all([H[i]>H[hs] for hs in dic[i]])for i in range(N)))

Buggy python submission (verdict: Time Limit Exceeded):
a=input().split()
N=int(a[0])
M=int(a[1])
H=[int(x) for x in input().split()]
way=[]
for i in range(M):
    way.append([int(x) for x in input().split()])

ans=0
for i in range(N):
    con_i=[]
    for j in range(M):
        if way[j][0]==i+1:
            con_i.append(way[j][1]-1)
        if way[j][1]==i+1:
            con_i.append(way[j][0]-1)
    
    higher=0    
    for k in con_i:
        if H[i]>H[k]:
            higher+=1
           
    if higher==len(con_i):
        ans+=1
    
print(ans)


            

        


Fixed submission:
a=input().split()
N=int(a[0])
M=int(a[1])
H=[int(x) for x in input().split()]
way=[]
for i in range(M):
    way.append([int(x) for x in input().split()])

dic={}
for i in range(N):
    dic[i]=set()

for h in way:
    dic[h[0]-1].add(h[1]-1)
    dic[h[1]-1].add(h[0]-1)
    

print(sum(all([H[i]>H[hs] for hs in dic[i]])for i in range(N)))
Buggy python submission (verdict: Runtime Error):
X=int(input())
import numpy as np
t=int(X**(1/5))+10
a=[]
for i in range(t):
    a.append(i**5)

b=[]
for i in range(t):
    for j in range(i+1,t):
        if a[i]+a[j]==X:
            b.append([i,-j])
        if a[j]-a[i]==X:
            b.append([i,j])
        
print(b[0][0],b[0][1])




Fixed submission:
x = int(input())
a=0
b=0
for i in range(-400,400):
    for j in range(-400,400):
        if i**5 - j**5 == x:
            a = i
            b = j
            exit

print(a,b)

Buggy python submission (verdict: Runtime Error):
X=int(input())
import numpy as np
t=int(X**(1/5))+10
i=-1
while  i < t:
    s=((i**5)+X)**(1/5)
    u=(X-(i**5))**(1/5)
    if s==int(s):
        print(i,int(s))
        break
    if u==int(u):
        print(i,int(-u))
        break
    i+=1








Fixed submission:
x = int(input())
a=0
b=0
for i in range(-400,400):
    for j in range(-400,400):
        if i**5 - j**5 == x:
            a = i
            b = j
            exit

print(a,b)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A_r=list(input().split())
A=[int(x) for x in A_r]
for i in range(N):
    print(len([j for j,x in enumerate(A) if x==i+1]))
    

Fixed submission:
N=int(input())
A_r=list(input().split())
A=[int(x) for x in A_r]
B=[0 for i in range(N)]

for i in range(len(A)):
    B[A[i]-1]+=1
for i in range(len(B)):
    print(B[i])