Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):


W, H, x, y = map(int, input().split())
bigarea = W * H

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

if j % 2 ==0:
    k = '1'
elif W /2 == x and H / 2 == y:
    k = '0'

if x == 0 and y == 0:
    j = 0

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))

Fixed submission:
W, H, x, y = map(int, input().split())
bigarea = W * H

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

if W /2 == x and H / 2 == y:
    k = '1'
else:
    k = '0'

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))

Buggy python submission (verdict: Runtime Error):


W, H, x, y = map(int, input().split())
bigarea = W * H

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

if j % 2 ==0:
    k = '1'
elif W /2 == x and H / 3 == y:
    k = '0'

if x == 0 and y == 0:
    j = 0

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))

Fixed submission:
W, H, x, y = map(int, input().split())
bigarea = W * H

j = (bigarea/2.000000)

# print('{:6f}'.format(bigarea/2))

if W /2 == x and H / 2 == y:
    k = '1'
else:
    k = '0'

# print(j, k)
# j = str(j)
print('{:6f} {:}'.format(j,k))
Buggy python submission (verdict: Runtime Error):
a, b = int(input().split())
x = a * b
if x % 2 == 1:
  print("Odd")
else:
  print("Even")

Fixed submission:
a, b = map(int, input().split())
x = a * b
if x % 2 == 1:
    print("Odd")
else:
    print("Even")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
x = a + b + c
print(x)

Fixed submission:
s = input()
print(s.count("1"))

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

Fixed submission:
s = input()
print(s.count("1"))
Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N = int(input())
A = list(map(int, input().split()))
mod =10**9 +7
a =0
for i in range(N-1):
    for j in range(i+1,N):
        #a +=(A[i] *A[j]) %mod
        a +=(A[i] *A[j])
a %=mod        
print(a)

Fixed submission:
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N = int(input())
A = list(map(int, input().split()))
mod =10**9 +7
sum_a =sum(A)
ans =0
for i in range(N-1):
    sum_a -=A[i]
    ans +=(A[i] *(sum_a)) %mod
ans %=mod        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
class UnionFind():
    #https://note.nkmk.me/python-union-find/ 
    #note.nkmk.me  2019-08-18 
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N,M = map(int, input().split())
G =UnionFind(N)
for i in range(M):
    a,b = map(int, input().split())
    #a,b =min(a,b),max(a,b)
    G.union(a-1,b-1)
members =G.all_group_members()

ans =0
for i in members.values():
    ans =max(ans,len(i))
print(ans)

Fixed submission:
class UnionFind():
    #https://note.nkmk.me/python-union-find/ 
    #note.nkmk.me  2019-08-18 
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N,M = map(int, input().split())
G =UnionFind(N)
ans =0
for i in range(M):
    a,b = map(int, input().split())
    #a,b =min(a,b),max(a,b)
    G.union(a-1,b-1)
    ans =max(ans,G.size(a-1))
if M ==0:
    print(1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

# 初期入力
import sys
from collections import deque
#input = sys.stdin.readline  #文字列では使わない
H,W = map(int, input().split())
S_h,S_w = map(int, input().split()) #スタート
G_h,G_w = map(int, input().split()) #ゴール

#迷路
mp =[["#"]*(W +4) for i in range(H +4)] #上下左右に２個分余分に壁を作る
for i in range(2,H+2):
    mp[i][2:-2] =input().strip() #迷路読み込み
    
S_h +=1 #壁を余分に作った分、スタートとゴールをずらす
S_w +=1
G_h +=1
G_w +=1
used =[[float('inf')]*(W +4) for i in range(H +4)] #既に通ったところを保存
used[S_h][S_w] =0
wap=[-2,-1,0,1,2] #ワープ移動できる縦横の範囲


dq =deque()
dq.append((0,S_h,S_w)) #キューには(コスト、x座標、y座標)を追加していく
arrive=False #ゴールに到着すればTrueに変更

while dq:
    k,i,j =dq.popleft()
    if k >used[i][j]: #既に通ったかどうか
        continue
    if i ==G_h and j ==G_w: #ゴール判定
        arrive =True
        break
    for di in wap:
        for dj in wap:
            if di ==0 and dj ==0: #その場から移動しない時
                continue
            ni,nj =i +di ,j +dj #移動後の座標(ni,nj)
            if mp[ni][nj] =="#": #移動先が壁の中
                continue
            if k <used[ni][nj]:
                if abs(di) +abs(dj) ==1: #歩行圏内(コスト:0)
                    nk =k
                    used[ni][nj] =nk
                    dq.appendleft((nk,ni,nj))
                else:                   #歩行圏外(コスト:１)
                    nk =k+1
                    used[ni][nj] =nk
                    dq.append((nk,ni,nj))
if arrive:
    ans =used[G_h][G_w]
else:
    ans =-1
print(ans)

Fixed submission:

# 初期入力
import sys
from collections import deque
#input = sys.stdin.readline  #文字列では使わない
H,W = map(int, input().split())
S_h,S_w = map(int, input().split()) #スタート
G_h,G_w = map(int, input().split()) #ゴール

#迷路
mp =[["#"]*(W +4) for i in range(H +4)] #上下左右に２個分余分に壁を作る
for i in range(2,H+2):
    mp[i][2:-2] =input().strip() #迷路読み込み
    
S_h +=1 #壁を余分に作った分、スタートとゴールをずらす
S_w +=1
G_h +=1
G_w +=1
used =[[float('inf')]*(W +4) for i in range(H +4)] #既に通ったところを保存
used[S_h][S_w] =0
wap=[-2,-1,0,1,2] #ワープ移動できる縦横の範囲


dq =deque()
dq.append((0,S_h,S_w)) #キューには(コスト、x座標、y座標)を追加していく
arrive=False #ゴールに到着すればTrueに変更

while dq:
    k,i,j =dq.popleft()
    if k >used[i][j]: #既に通ったかどうか
        continue
    if i ==G_h and j ==G_w: #ゴール判定
        arrive =True
        break
    for di in wap:
        for dj in wap:
            if di ==0 and dj ==0: #その場から移動しない時
                continue
            ni,nj =i +di ,j +dj #移動後の座標(ni,nj)
            if mp[ni][nj] =="#": #移動先が壁の中
                continue
            if k <used[ni][nj]:
                if abs(di) +abs(dj) ==1: #歩行圏内(コスト:0)
                    nk =k
                    used[ni][nj] =nk
                    dq.appendleft((nk,ni,nj))
                else:                   #歩行圏外(コスト:１)
                    nk =k+1
                    used[ni][nj] =nk
                    dq.append((nk,ni,nj))
if arrive:
    ans =used[G_h][G_w]
else:
    ans =-1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
K = int(input())

count =1
x=7

if K %2 ==0 or K %5 ==0:
    count = -1
else:
    while x %K !=0:
        count +=1
        x = x*10 +7
        #print(x,end =" ")
print(count)

Fixed submission:
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
K = int(input())

count =1
x=7 %K

if K %2 ==0 or K %5 ==0:
    count = -1
else:

    while x %K !=0:
        count +=1
        x = (x*10 +7)%K
        #print(x,end =" ")
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N,K = map(int, input().split())
A = list(map(int, input().split()))
aa =1
DP =[0]*(N-K+1)
for i in A[:K]:
    aa *=i
DP[0] =aa

for i in range(N -K):
    DP[i+1] =DP[i]*A[i+K]//A[i]
    if DP[i+1] >DP[i]:
        print("Yes")
    else:
        print("No")

Fixed submission:
#解説を見て
# 初期入力
import sys
input = sys.stdin.readline  #文字列では使わない
N,K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(N -K):
    if A[i] <A[i+K]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import numpy as np
import sys
input = sys.stdin.readline
N = int(input())

#約数リストを作る
ans =0
div = np.zeros(N+1, np.int64)
for n in range(1, N+1):
    div[n:N+1:n] += 1

ans =0
for i in range(1,N+1):
    ans += i *div[i]
print(ans)

Fixed submission:
#https://www.youtube.com/watch?v=3gFnZhZlAF8
#【競プロ実況】ABC172 AからD問題【かつっぱ】
# 等差数列の和
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
ans =0
for i in range(1,N+1):
    n =N//i #項数
    ans +=n*(2*i +(n-1)*i)//2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())

#約数リストを作る
ans =0
for n in range(1, N+1):
    for m in range(n, N+1, n):
        ans +=m

print(ans)

Fixed submission:
#https://www.youtube.com/watch?v=3gFnZhZlAF8
#【競プロ実況】ABC172 AからD問題【かつっぱ】
# 等差数列の和
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
ans =0
for i in range(1,N+1):
    n =N//i #項数
    ans +=n*(2*i +(n-1)*i)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
#######関数部分##############
#url http://iatlex.com/python/base_change
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+" "+str(X%n)
    return str(X%n)
############################

# 初期入力
import sys
input = sys.stdin.readline
N = int(input())

#26進数に変換
x26 = Base_10_to_n(N-1, 26) 
x26_list =x26.split()
int_str =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

#26進数⇒文字
if x26_list[0] =="1":
    del x26_list[0]
ans =""
for i in range(len(x26_list)-1):
    a =x26_list[i]
    x =int_str[int(a)-1]
    ans +=x
ans +=int_str[int(x26_list[-1])]
ans_list =list(ans)

print(ans)

Fixed submission:
#######関数部分##############
#url http://iatlex.com/python/base_change
def Base_10_to_n(X, n):
    if (int((X-1)/n)):
        return Base_10_to_n(int((X-1)/n), n)+" "+str((X-1)%n)
    return str(X%n)
############################

# 初期入力
import sys
input = sys.stdin.readline
N = int(input())

#26進数に変換
x26 = Base_10_to_n(N, 26) 
x26_list =list(x26.split())
#x26_list.remove(" ")
int_str =["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]

#26進数⇒文字
ans =""
if len(x26_list) ==1:
    ans +=int_str[int(x26_list[0])-1]
else:
    ans +=int_str[int(x26_list[0])-1]

    for i in range(1,len(x26_list)):
        a =x26_list[i]
        x =int_str[int(a)]
        ans +=x

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import numpy as np
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A_np =np.array(A,dtype=np.int64)
Q = int(input())
S =[0]*Q
for i in range(Q):
    b,c = (int(i) for i in input().split())
    A_np =np.where(A_np ==b,c,A_np)
    S[i] =np.sum(A_np)
    #print(A_np)


print(*S,sep='\n')

Fixed submission:
# 初期入力
from collections import Counter
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A_c =Counter(A)
Q = int(input())
S =[0]*Q
bc =[]
for i in range(Q):
    x,y = (int(i) for i in input().split())
    bc.append((x,y))
    #print(A_np)
sum_A =[0]*(Q+1)
sum_A[0] =sum(A)
ind =0
for k,v in bc:
    sum_A[ind+1] =sum_A[ind] -A_c[k] *k +A_c[k] *v
    A_c[v] +=A_c[k]
    A_c[k] =0
    #print(A_c)
    print(sum_A[ind +1])
    ind +=1
Buggy python submission (verdict: Runtime Error):
# 初期入力
import sys
input = sys.stdin.readline
X,N = (int(i) for i in input().split())
if N !=0:
    p = list(map(int, input().split()))
else:
    p=[-1]
#
ans =[]
for i in range(1,101):
    if i not in p:
        ans.append((abs(i-X),i))
ans.sort()
print(ans[0][1])

Fixed submission:
# 初期入力
import sys
input = sys.stdin.readline
X,N = (int(i) for i in input().split())
if N !=0:
    p = list(map(int, input().split()))
elif N ==0:
    p=[-1]
p.sort()
#
ans =[]
for i in range(-1,102):
    if i not in p:
        ans.append((abs(i-X),i))
ans.sort()
print(ans[0][1])

Buggy python submission (verdict: Runtime Error):
# 初期入力
import sys
input = sys.stdin.readline
X,N = (int(i) for i in input().split())
if N !=0:
    p = list(map(int, input().split()))
else:
    p=[-1]
#
ans =[]
for i in range(1,101):
    if i not in p:
        ans.append((abs(i-X),i))
ans.sort()
print(ans[0][1])
aa=0

Fixed submission:
# 初期入力
import sys
input = sys.stdin.readline
X,N = (int(i) for i in input().split())
if N !=0:
    p = list(map(int, input().split()))
elif N ==0:
    p=[-1]
p.sort()
#
ans =[]
for i in range(-1,102):
    if i not in p:
        ans.append((abs(i-X),i))
ans.sort()
print(ans[0][1])
Buggy python submission (verdict: Runtime Error):
import numpy as np 
N = int(input())
A = list(map(int, input().split()))
A =np.array(A,dtype=np.int64)

#
ans =0
if 0 in A:
    ans =0:
else:
    ans =np.prod(A)
    if ans >10**18:
        ans =-1
print(ans)

Fixed submission:
# 初期入力
import numpy as np
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
ans =1
if 0 in A:
    ans =0
else:
    for i in A:
        ans *=i
        if 10**18 < ans :
            ans = -1
            break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
ans =1
for i in A:
    ans *=i
if ans <=10**18:
    print(ans)
else:
    print(-1)

Fixed submission:
# 初期入力
import numpy as np
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
ans =1
if 0 in A:
    ans =0
else:
    for i in A:
        ans *=i
        if 10**18 < ans :
            ans = -1
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
# 初期入力
import numpy as np
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A_np =np.array(A,dtype=np.int64)
ans =np.prod(A_np)
if 0 in A:
    print(0)
elif 0 < ans <=10**18:
    print(ans)
else:
    print(-1)

Fixed submission:
# 初期入力
from decimal import Decimal
import sys
input = sys.stdin.readline
A,B = (str(x) for x in input().split())
a =Decimal(A)
b =Decimal(B)
ans =int(a *b)
print(ans)

Buggy python submission (verdict: Runtime Error):
# 初期入力
from decimal import Decimal
import sys
input = sys.stdin.readline
A,B = (str(x) for x in input().split())
a =Decimal(A)
b =Decimal(B)
ans =int(A *B)
print(ans)

Fixed submission:
# 初期入力
from decimal import Decimal
import sys
input = sys.stdin.readline
A,B = (str(x) for x in input().split())
a =Decimal(A)
b =Decimal(B)
ans =int(a *b)
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque
N,Q = (int(x) for x in input().split())
connection ={i:[] for i in range(1,N+1)}
#木の構造
for i in range(1,N):
    a,b = (int(x) for x in input().split())
    connection[a].append(b)
    connection[b].append(a)

#各頂点のポイント入力
point ={i:0 for i in range(1,N+1)}
for i in range(1,Q+1):
    p,x = (int(x) for x in input().split())
    point[p] =x

#深さ優先探索
dq =deque()
dq.append(1)
passed ={i:0 for i in range(1,N+1)} #各頂点を通過チェック、０は未通過
while dq:
    now =dq.pop()
    passed[now] =1
    for next in connection[now]:
        if passed[next] ==1:
            continue
        point[next] +=point[now]
        dq.append(next)
        #print(next,end=" ")
print(*point.values())

Fixed submission:

from collections import deque
import sys
input = sys.stdin.readline
N,M = (int(x) for x in input().split())
connection ={i:set() for i in range(1,N+1)}

#構造入力
for i in range(1,M+1):
    a,b = (int(x) for x in input().split())
    connection[a].add(b)
    connection[b].add(a)

#幅優先探索
dq =deque()
dq.append(1)
parent ={i:-1 for i in range(1,N+1)} #1につながっている＝答え
parent[1] =0
while dq:
    now =dq.popleft()
    for next in connection[now]:
        if parent[next] !=-1:
            continue
        else:
            parent[next] =now
            dq.append(next)
if -1 not in parent.values():
    del parent[1]
    print("Yes")
    print(*parent.values(),sep="\n")
Buggy python submission (verdict: Runtime Error):
# 初期入力
from collections import Counter
from copy import deepcopy
import sys
input = sys.stdin.readline
N,K = (int(x) for x in input().split())
A = list(map(int, input().split()))
connection ={}
for i,v in enumerate(A):
    connection[i+1] =v 

#巡回してるか
passed=[1]
nex =connection[1]
lap =[]
lap_num =0
pass_set =set()
for i in range(1,N+1):
    passed.append(nex)
    if nex not in pass_set:
        pass_set.add(nex)
        nex =connection[nex]
    else:
        #lap =deepcopy(passed)
        break
#巡回している部分の町の数    
indx_s =passed.index(nex) +1
indx_f =len(passed)
lap_num =indx_f -indx_s

if indx_f < K:
    mod =(K -indx_s) % lap_num
    ans =passed[indx_s +mod]
else:
    ans =passed[K]
print(ans)

Fixed submission:
# 初期入力
from collections import Counter
from copy import deepcopy
import sys
input = sys.stdin.readline
N,K = (int(x) for x in input().split())
A = list(map(int, input().split()))
connection ={}
for i,v in enumerate(A):
    connection[i+1] =v 

#巡回してるか
passed=[1]
nex =connection[1]
lap =[]
lap_num =0
pass_set =set(passed)
for i in range(1,N+1):
    passed.append(nex)
    if nex not in pass_set:
        pass_set.add(nex)
        nex =connection[nex]
    else:
        #lap =deepcopy(passed)
        break
#巡回している部分の町の数    
indx_s =passed.index(nex) +1
indx_f =len(passed)
lap_num =indx_f -indx_s

if indx_f < K:
    mod =(K -indx_s) % lap_num
    ans =passed[indx_s +mod]
else:
    ans =passed[K]
print(ans)

Buggy python submission (verdict: Runtime Error):
# 初期入力
from collections import Counter
from copy import deepcopy
import sys
input = sys.stdin.readline
N,K = (int(x) for x in input().split())
A = list(map(int, input().split()))
connection ={}
for i,v in enumerate(A):
    connection[i+1] =v 

#巡回してるか
passed=[1]
nex =connection[1]
lap =[]
for i in range(1,N+1):
    passed.append(nex)
    c=Counter(passed)
    if 2  not in c.values():
        nex =connection[nex]
    else:
        lap =deepcopy(passed)
        indx_s =passed.index(nex) +1
        indx_f =len(lap)
        lap_num =indx_f -indx_s
        break

mod =(K -indx_s)//lap_num
ans =passed[indx_s +mod]
print(ans)

Fixed submission:
# 初期入力
from collections import Counter
from copy import deepcopy
import sys
input = sys.stdin.readline
N,K = (int(x) for x in input().split())
A = list(map(int, input().split()))
connection ={}
for i,v in enumerate(A):
    connection[i+1] =v 

#巡回してるか
passed=[1]
nex =connection[1]
lap =[]
lap_num =0
pass_set =set(passed)
for i in range(1,N+1):
    passed.append(nex)
    if nex not in pass_set:
        pass_set.add(nex)
        nex =connection[nex]
    else:
        #lap =deepcopy(passed)
        break
#巡回している部分の町の数    
indx_s =passed.index(nex) +1
indx_f =len(passed)
lap_num =indx_f -indx_s

if indx_f < K:
    mod =(K -indx_s) % lap_num
    ans =passed[indx_s +mod]
else:
    ans =passed[K]
print(ans)
Buggy python submission (verdict: Runtime Error):
# 初期入力
import sys
input = sys.stdin.readline
N,M = (int(x) for x in input().split())
H = [-1]+list(map(int, input().split()))

#observ_H =[i for i in range(1,N+1)]
observ_H ={}
connction ={i:set() for i in range(1,N+1)}

#つながり
for i in range(1,M+1):
    a,b = (int(x) for x in input().split())
    connction[a].add(b)
    connction[b].add(a)
    
#展望台の高さ、辞書
for i in range(1,N+1):
    observ_H[i] = H[i]
#observ_H.sort(key=lambda x:x[1],reverse=True)
observ_good ={i:"bad"}
hantei="bad"
for num,connect in connction.items():
    hantei ="bad"
    for saki in connect:
        if observ_H[num] > observ_H[saki]:
            hantei ="good"
    if hantei=="good":
        observ_good[num] ="good"
print(len(i))


Fixed submission:
# 初期入力
import sys
input = sys.stdin.readline
N,M = (int(x) for x in input().split())
H = [-1]+list(map(int, input().split()))

#observ_H =[i for i in range(1,N+1)]
observ_H ={}
connection ={i:set() for i in range(1,N+1)}

#つながり
for i in range(1,M+1):
    a,b = (int(x) for x in input().split())
    connection[a].add(b)
    connection[b].add(a)
    
#展望台の高さ、辞書
for i in range(1,N+1):
    observ_H[i] = H[i]
#observ_H.sort(key=lambda x:x[1],reverse=True)
observ_good ={}
hantei=1
for num,connect in connection.items():
    hantei =1
    for saki in connect:
        if observ_H[num] > observ_H[saki]:
            hantei *=1
        else:
            hantei=0
    if hantei==1:
        observ_good[num] ="good"
print(len(observ_good))
Buggy python submission (verdict: Runtime Error):
X = int(input())
y =120
a ={i**5 for i in range(-y,y)}
ans_a =0
ans_b =0
for b in range(-y,y):
    if X +b**5 in a:
        #ans_a =int( (X +b**5 +1)**0.2 )
        ans_a =int( (X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Fixed submission:
# 初期入力
import sys
import math
#input = sys.stdin.readline
X = int(input())
limit =10**5
a=0
b=0
for b in range(-1*limit ,limit):
    a5 =X+pow(b,5)
    if 0 <= a5: 
        a=math.pow(a5,0.2)
        a_int =int(a)
        dif =a_int**5 -b**5 -X
        if abs(dif)<10**(-5):
            break
    else:
        continue
print(a_int,b)

Buggy python submission (verdict: Runtime Error):
X = int(input())
y =2*10**2
a ={i**5 for i in range(-y,y)}
ans_a =0
ans_b =0
for b in range(-y,y):
    if X +b**5 in a:
        #ans_a =int( (X +b**5 +1)**0.2 )
        ans_a =int( (X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Fixed submission:
# 初期入力
import sys
import math
#input = sys.stdin.readline
X = int(input())
limit =10**5
a=0
b=0
for b in range(-1*limit ,limit):
    a5 =X+pow(b,5)
    if 0 <= a5: 
        a=math.pow(a5,0.2)
        a_int =int(a)
        dif =a_int**5 -b**5 -X
        if abs(dif)<10**(-5):
            break
    else:
        continue
print(a_int,b)

Buggy python submission (verdict: Runtime Error):
X = int(input())
a ={i**5 for i in range(-10**5,10**5)}
ans_a =0
ans_b =0
for b in range(-10**5,10**5):
    if X +b**5 in a:
        #ans_a =int( (X +b**5 +1)**0.2 )
        ans_a =int( (X +b**5 )**0.2 )
        ans_b =b
        break
print(ans_a,ans_b)

Fixed submission:
# 初期入力
import sys
import math
#input = sys.stdin.readline
X = int(input())
limit =10**5
a=0
b=0
for b in range(-1*limit ,limit):
    a5 =X+pow(b,5)
    if 0 <= a5: 
        a=math.pow(a5,0.2)
        a_int =int(a)
        dif =a_int**5 -b**5 -X
        if abs(dif)<10**(-5):
            break
    else:
        continue
print(a_int,b)