Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
L0=2
L1=0
if N == 1
　　return L0
elif N == 2:
    return L1
else:
    for i in range(N-2):
            L0, L1 = L1, L0+L1
        return L1
        print()

Fixed submission:
def main():
    A, B, C, D = input()
    for i in range(2**3):
        op = ['+', '+', '+']
        for j in range(len(op)):
            if (i >> j) & 1:
                op[j] = '-'
        if eval(A + op[0] + B + op[1] + C + op[2] + D) == 7:
            print(A + op[0] + B + op[1] + C + op[2] + D + '=7')
            break
if __name__  == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
A,B,C,D=input()
for i in range(2**3):
	op = ["+","+","+"]
    for j in range(len(op)):
      if (i>>j) & 1:
        op[j]="-"
        




def main():
    A, B, C, D = input()
    for i in range(2**3):
        op = ['+', '+', '+']
        for j in range(len(op)):
            if (i >> j) & 1:
                op[j] = '-'
        if eval(A + op[0] + B + op[1] + C + op[2] + D) == 7:
            print(A + op[0] + B + op[1] + C + op[2] + D + '=7')
            break

    main()
  

Fixed submission:
def main():
    A, B, C, D = input()
    for i in range(2**3):
        op = ['+', '+', '+']
        for j in range(len(op)):
            if (i >> j) & 1:
                op[j] = '-'
        if eval(A + op[0] + B + op[1] + C + op[2] + D) == 7:
            print(A + op[0] + B + op[1] + C + op[2] + D + '=7')
            break
if __name__  == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    As = list(map(int, input().split()))

    sum_ = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            sum_ += ((As[i] % (10 ** 9 + 7)) * (As[j] % (10 ** 9 + 7))) % (10 ** 9 + 7)

    sum_ %= 10 ** 9 + 7
    print(sum_)


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    d, t, s = map(int, input().split())
    if d <= t * s:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

d,t,s = map(int,input().split())

if (d − s*t <= 0):
  print('Yes')
else :
  print('No')


Fixed submission:
d,t,s = map(int,input().split())
if (d - s*t <= 0):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
d = int(input())
t,s = map(int,input().split())

if d − s*t <= 0:
  print('Yes')
else :
  print('No')


Fixed submission:
d,t,s = map(int,input().split())
if (d - s*t <= 0):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
d = int(input())
t,s = map(int,input().split())

if d − s*t <= 0:
  print('Yes')
else print('No')


Fixed submission:
d,t,s = map(int,input().split())
if (d - s*t <= 0):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
d = input().split()
t,s = map(int,input().split())

if d − s*t < 0:
  print('Yes')
else print('No')

Fixed submission:
d,t,s = map(int,input().split())
if (d - s*t <= 0):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = input().split()  

answer = 1

for i in range(N) :
    answer = answer * int(A[i])


if answer > 1000000000000000000 : 
    print('-1')
    quit()


print(answer)     

Fixed submission:
N = int(input())

A = input().split()  

answer = 1

sort = sorted(A)

for i in range(N) :
    answer = answer * int(sort[i])
    if answer == 0:
        print('0')
        quit()
    if answer > 1000000000000000000 : 
        print('-1')
        quit()


print(answer)
Buggy python submission (verdict: Runtime Error):
S = int(input())
W = int(input())
if W >= S :
    print('unsafe')
else :
    print('safe')

Fixed submission:
S,W = map(int,input().split(' '))
if W >= S :
    print('unsafe')
else :
    print('safe')
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=0
for i in range(k):
  if x<0:
    x+=d
  else:
    x-=d
  if abs(x)<m:
    m=abs(x)
  else:
    n=k-i
    break
if n%2==0:
  print(m)
else:
  print(abs(x))

Fixed submission:
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=m//d
j=k-n
if j>0:
  if x<0:
    if j%2==0:
      x+=d*n
    else:
      x+=d*(n+1)
  else:
    if j%2==0:
      x-=d*n
    else:
      x-=d*(n+1)
else:
  if x<0:
    x+=d*k
  else:
    x-=d*k
print(abs(x))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
if x<0:
  for i in range(k):
    x+=d
    if abs(x)<m:
      m=abs(x)
    else:
      n=k-i
      break
  if n%2==0:
    print(m)
  else:
    print(abs(x))
else:
  for i in range(k):
    x-=d
    if abs(x)<m:
      m=abs(x)
    else:
      n=k-i
      break
  if n%2==0:
    print(m)
  else:
    print(abs(x))

Fixed submission:
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=m//d
j=k-n
if j>0:
  if x<0:
    if j%2==0:
      x+=d*n
    else:
      x+=d*(n+1)
  else:
    if j%2==0:
      x-=d*n
    else:
      x-=d*(n+1)
else:
  if x<0:
    x+=d*k
  else:
    x-=d*k
print(abs(x))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
if x<0:
  x+=d*k
  m=abs(x)
  for i in range(k):
    x-=d*2
    if abs(x)<m:
      m=abs(x)
    else:
      break
  print(m)
else:
  x-=d*k
  m=abs(x)
  for i in range(k):
    x+=d*2
    if abs(x)<m:
      m=abs(x)
    else:
      break
  print(m)

Fixed submission:
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=m//d
j=k-n
if j>0:
  if x<0:
    if j%2==0:
      x+=d*n
    else:
      x+=d*(n+1)
  else:
    if j%2==0:
      x-=d*n
    else:
      x-=d*(n+1)
else:
  if x<0:
    x+=d*k
  else:
    x-=d*k
print(abs(x))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
x+=d*k
m=abs(x)
for i in range(k):
  x-=d*2
  if abs(x)<m:
    m=abs(x)
  else:
    break
print(m)

Fixed submission:
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=m//d
j=k-n
if j>0:
  if x<0:
    if j%2==0:
      x+=d*n
    else:
      x+=d*(n+1)
  else:
    if j%2==0:
      x-=d*n
    else:
      x-=d*(n+1)
else:
  if x<0:
    x+=d*k
  else:
    x-=d*k
print(abs(x))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
h=[-1]*k
s=7
for i in range(k):
  m=s%k
  if h[0]==m:
    l=i+1
    break
  h[i]=m
  s=m*10+7
for i in range(l):
  if h[i]==0:
    print(i+1)
    break

Fixed submission:
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
s=7
for i in range(k):
  m=s%k
  if m==0:
    print(i+1)
    break
  s=m*10+7

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
h=[-1]*k
s=7
for i in range(k):
  m=s%k
  if h[0]==m:
    l=i
    break
  h[i]=m
  s=m*10+7
for i in range(l):
  if h[i]==0:
    print(i+1)
    break

Fixed submission:
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
s=7
for i in range(k):
  m=s%k
  if m==0:
    print(i+1)
    break
  s=m*10+7

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
k=int(input())
i=1
s=7
while True:
  m=s%k
  if m==0:
    print(i)
    break
  s=m*10+7
  i+=1

Fixed submission:
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
s=7
for i in range(k):
  m=s%k
  if m==0:
    print(i+1)
    break
  s=m*10+7

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
k=int(input())
if k%7==0:
  l=9*k/7
else:
  l=9*k
if l%2==0 or l%5==0:
  print(-1)
i=1
while True:
  s=10**i
  if l<=s:
    break
  i+=1
while True:
  j=s%l
  if j==1:
    print(i)
    break
  i+=1
  s=j*10

Fixed submission:
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
s=7
for i in range(k):
  m=s%k
  if m==0:
    print(i+1)
    break
  s=m*10+7

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
k=int(input())
if k%7==0:
  l=9*k/7
else:
  l=9*k
if l%2==0 or l%5==0:
  print(-1)
i=1
s=10
while True:
  j=s%l
  if j==1:
    print(i)
    break
  i+=1
  s=j*10

Fixed submission:
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
s=7
for i in range(k):
  m=s%k
  if m==0:
    print(i+1)
    break
  s=m*10+7

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
k=int(input())
n=-1
if k%2==0:
  print(n)
  sys.exit()
l=1
while True:
  s=(7*(10**l-1))/9
  if s%k==0:
    print(l)
    break
  l+=1

Fixed submission:
# -*- coding: utf-8 -*-
import sys
k=int(input())
if k%2==0 or k%5==0:
  print(-1)
  sys.exit()
s=7
for i in range(k):
  m=s%k
  if m==0:
    print(i+1)
    break
  s=m*10+7
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n=int(input())
for val in range(1,n+1):
  ans=0
  if val<100:
    x=val
  else:
    x=100
  for i in range(1,x+1):
    for j in range(1,i+1):
      for k in range(1,j+1):
        sumg=(i+j)**2+(j+k)**2+(k+i)**2
        if sumg==2*val:
          if i==j and j==k:
            ans+=1
          elif i!=j and j!=k and k!=i:
            ans+=6
          else:
            ans+=3
  print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
ans=[0 for i in range(10500)]
for i in range(1,105):
  for j in range(1,i+1):
    for k in range(1,j+1):
      sumg=(i+j)**2+(j+k)**2+(k+i)**2
      if sumg<21000:
        if i==j and j==k:
          ans[int(sumg/2)]+=1
        elif i!=j and j!=k and k!=i:
          ans[int(sumg/2)]+=6
        else:
          ans[int(sumg/2)]+=3
for i in range(n):
  print(ans[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n=int(input())
sumy=0
for i in range(n):
  t=i+1
  k=int(n/t)
  sumy+=int(t*k*(k+1)/2)
print(sumy)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
sumy=0
#nの半分より上の倍数は1個なのでそこで分ける
numhalf=int(n/2)
#nの半分までは倍数ごとに個数を求めて足していく
for i in range(numhalf):
  t=i+1
  k=int(n/t)
  sumy+=int(t*k*(k+1)/2)
#半分より上の倍数はすべて1個ずつなのでまとめて足す
sumy+=int((n+numhalf+1)*(n-numhalf)/2)
print(sumy)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n=int(input())
#答え
sumy=0
#約数の個数を各値ごとにリストに入れる
cnt1=[]
#各値ごとの約数の個数
cnt2=0
for i in range(n+1):
  for j in range(i):
#0で割るのを防ぐ
    k=j+1
#商が割る数より小さいときは二重に数えることになるので省く
    if i/k<k:
      break
    else:
#約数であるかを確認
      if i%k==0:
        if k==i/k:
          cnt2+=1
#計算量を減らすためにペアで数える(商と割る数)
        else:
          cnt2+=2
  cnt1.append(cnt2)
#cntを初期化
  cnt2=0    
  sumy+=cnt1[i]*i
print(sumy)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
sumy=0
#nの半分より上の倍数は1個なのでそこで分ける
numhalf=int(n/2)
#nの半分までは倍数ごとに個数を求めて足していく
for i in range(numhalf):
  t=i+1
  k=int(n/t)
  sumy+=int(t*k*(k+1)/2)
#半分より上の倍数はすべて1個ずつなのでまとめて足す
sumy+=int((n+numhalf+1)*(n-numhalf)/2)
print(sumy)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n=int(input())
#答え
sumy=0
#約数の個数を各値ごとにリストに入れる
cnt1=[]
#各値ごとの約数の個数
cnt2=0
for i in range(n+1):
  for j in range(i):
#0で割るのを防ぐ
    k=j+1
#商が割る数より小さいときは二重に数えることになるので省く
    if i/k<k:
      continue
    else:
#約数であるかを確認
      if i%k==0:
        if k==i/k:
          cnt2+=1
#計算量を減らすためにペアで数える(商と割る数)
        else:
          cnt2+=2
  cnt1.append(cnt2)
#cntを初期化
  cnt2=0    
  sumy+=cnt1[i]*i
print(sumy)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
sumy=0
#nの半分より上の倍数は1個なのでそこで分ける
numhalf=int(n/2)
#nの半分までは倍数ごとに個数を求めて足していく
for i in range(numhalf):
  t=i+1
  k=int(n/t)
  sumy+=int(t*k*(k+1)/2)
#半分より上の倍数はすべて1個ずつなのでまとめて足す
sumy+=int((n+numhalf+1)*(n-numhalf)/2)
print(sumy)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
#階乗計算
from math import factorial
n,m=map(int,input().split())
nf=factorial(n)
mf=factorial(m)
mnf=factorial((m-n))
#n=mの時
def ko1(x):
  kosuu1=0
  for i in range(x+1):
    kf=factorial(i)
    kosuu1+=int((nf/kf)*((-1)**i))
  kosuu1*=nf
  return kosuu1
#n<mの時
def ko2(x,y):
  kosuu2=0
  for i in range(x+1):
    kf=factorial(i)
    mi=factorial((y-i))
    ni=factorial((x-i))
    kosuu2+=int((((-1)**i)*mi*nf)/(ni*mnf*kf))
  kosuu2*=int(mf/mnf)
  return kosuu2
if n==m:
  kosuu=int(ko1(n)/(10**9+1))
else:
  kosuu=int((ko2(n,m))%(10**9+1))
print(kosuu)

Fixed submission:
# -*- coding: utf-8 -*-
#nCをp(=10**9+7)で割ったときのあまり(モジュラ逆数)
def cmb(n,r,p):
  if r<0 or n<r:
    return 0
  r=min(r,n-r)
  return facto[n]*factoinv[r]*factoinv[n-r]%p
p=10**9+7
n,m=map(int,input().split())
#0,1の時の値をいれたn!のリスト(modp)
facto=[1,1]
#0,1の時の値をいれたn!の逆元のリスト(modp)
factoinv=[1,1]
#0,1の場合を入れたn!の逆元も求めるために使うnの逆元のリスト(modp)
inv=[0,1]
#2からスタート
for i in range(2,m+1):
  facto.append((facto[-1]*i)%p)
  inv.append((-inv[p%i]*(p//i))%p)
  factoinv.append((factoinv[-1]*inv[-1])%p)
if n==m:
  kosuub=0
  for i in range(n+1):
    kosuub+=(facto[(n-i)]*cmb(n,i,p)*((-1)**i))%p
  kosuu=(kosuub*facto[(n)])%p
  print(kosuu)
else:
  kosuub=0
  for i in range(n+1):
    kosuub+=(cmb((m-i),(n-i),p)*facto[(n-i)]*cmb(n,i,p)*((-1)**i))%p
  kosuu=(kosuub*cmb(m,n,p)*facto[n])%p
  print(kosuu)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n=int(input())
#アルファベットのリスト
alphlist=[chr(ord('a')+i)for i in range(26)]
l=0
maxnum=int((1.0e+15)+1)
numlist=[0]
#公比26の等比数列の和のリスト(numlist)
while True:
  l+=1
  numlist.append(numlist[l-1]+26**l)
  if numlist[l]>maxnum:
    break
#名前に使われる文字の個数(continum)
continum=0
for i in range(l):
  if numlist[i]<=n and numlist[i+1]>=n:
    continum=i+1
    break
#文字を決める(左から順に)
anslist=[]
for i in range(continum,0,-1):
  s=26**(i-1)
  num=int(n/s)
  n-=num*s
  anslist.append(alphlist[num-1])
ans=str()
for val in anslist:
  ans+=val
print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
namelist=[]
name=''
while n>0:
  n-=1
  namelist.append(chr(ord('a')+n%26))
  n=int(n/26)
for i in namelist[::-1]:
  name+=i
print(name)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
#aの合計を求める(suma)
suma=0
for i in range(n):
  suma+=numlista[i]
#1~10000がそれぞれいくつあるのか調べる(numkosuu)
numkosuu=[]
for i in range(100000):
  numkosuu.append(numlista.count(i+1))
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化したところのみ計算する
  suma+=(c-b)*numkosuu[b-1]
#個数を更新する
  numkosuu[c-1]+=numkosuu[b-1]
  numkosuu[b-1]=0
  print(suma)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
import collections
numkosuu=collections.Counter(numlista)
suma=0
for i in numlista:
  suma+=i
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化したところのみ計算する
  suma+=(c-b)*numkosuu[b]
#個数を更新する
  numkosuu[c]+=numkosuu[b]
  numkosuu[b]=0
  print(suma)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
#aの合計を求める(suma)
suma=0
for i in range(n):
  suma+=numlista[i]
#1~10000がそれぞれいくつあるのか調べる(numkosuu)
numkosuu=[]
for i in range(100000):
  numkosuu.append(numlista.count(i+1))
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化量を求める
  k=c-b
  o=numkosuu[b-1]
#変化したところのみ計算する
  suma+=k*o
#個数を更新する
  numkosuu[b]+=numkosuu[b-1]
  numkosuu[b-1]=0
  print(suma)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
import collections
numkosuu=collections.Counter(numlista)
suma=0
for i in numlista:
  suma+=i
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化したところのみ計算する
  suma+=(c-b)*numkosuu[b]
#個数を更新する
  numkosuu[c]+=numkosuu[b]
  numkosuu[b]=0
  print(suma)

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n=int(input())
numlista=map(int,input().split())
#aの合計を求める
suma=0
for i in range(n):
  suma+=numlista[i]
#
#q=int(input())
#for i in range(q):
#  b,c=int(input().split())
#  k=c-b
print(numlista)
print(suma)

Fixed submission:
# -*- coding: utf-8 -*-
n=int(input())
numlista=list(map(int,input().split()))
import collections
numkosuu=collections.Counter(numlista)
suma=0
for i in numlista:
  suma+=i
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
#変化したところのみ計算する
  suma+=(c-b)*numkosuu[b]
#個数を更新する
  numkosuu[c]+=numkosuu[b]
  numkosuu[b]=0
  print(suma)
Buggy python submission (verdict: Runtime Error):
a, b, c = list(map(int, input().split))
k = int(input())
while k != 0:
    if b < a:
        b *= 2
    elif c < b:
        c *= 2
    else:
        break
    k -= 1
if (b > a) and (c > b):
    print('Yes')
else:
    print('No')

Fixed submission:
a, b, c = list(map(int, input().split()))
k = int(input())
while k != 0:
    if b <= a:
        b *= 2
    elif c <= b:
        c *= 2
    else:
        break
    k -= 1
if (b > a) and (c > b):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C=map(int,input().split())
K=int(input())
x=0
while x<K:
  if A>B:
    B*=2
    x+=1
  elif B>C:
    C*=2
    x+=1
  elif C>B>A:
    break
if C>B>A:
  print("Yes")
else:
  print("No")

Fixed submission:
A, B, C=map(int,input().split())
K=int(input())
ab=int(A/B)
if ab==0:
  x=0
else:
  x=int(len(bin(ab))-2)
B1=B*(2**x)
bc=int(B1/C)
if bc==0:
  y=0
else:
  y=int(len(bin(bc))-2)
if x+y<=K:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Time Limit Exceeded):
A, B, C=map(int,input().split())
K=int(input())
x=0
while x<K:
  if A>B:
    B*=2
    x+=1
  elif B>C:
    C*=2
    x+=1
if C>B>A:
  print("Yes")
else:
  print("No")

Fixed submission:
A, B, C=map(int,input().split())
K=int(input())
ab=int(A/B)
if ab==0:
  x=0
else:
  x=int(len(bin(ab))-2)
B1=B*(2**x)
bc=int(B1/C)
if bc==0:
  y=0
else:
  y=int(len(bin(bc))-2)
if x+y<=K:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, M=map(int,input().split())
H=list(map(int,input().split()))
A=[0]*M
B=[0]*M
for i in range(M):
  A[i], B[i]=map(int,input().split())
answer=0
for i in range(N):
  X=[H[i]]
  for j in range(M):
    if (i+1)== A[j]:
      X.append(H[B[j]-1])
    elif (i+1)==B[j]:
      X.append(H[A[j]-1])

  if H[i]==max(X) and X.count(max(X))==1:
    answer+=1
print(answer)

Fixed submission:
N, M=map(int,input().split())
H=list(map(int,input().split()))
ans=[1]*N
for i in range(M):
  A, B=map(int,input().split())
  x=H[A-1]
  y=H[B-1]
  if x>y:
    ans[B-1]=0
  elif x==y:
    ans[B-1]=0
    ans[A-1]=0
  elif y>x:
    ans[A-1]=0   
print(sum(ans))
Buggy python submission (verdict: Runtime Error):
s = input()
if(s[1:2]==s[2:3] and s[3:4]==s[4:5]){print("Yes")}
else{print("No")}

Fixed submission:
s = input()
if(s[2:3]==s[3:4] and s[4:5]==s[5:6]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
if(s[2:3]==s[3:4] and s[4:5]==s[5:6]){print("Yes")}
else{print("No")}

Fixed submission:
s = input()
if(s[2:3]==s[3:4] and s[4:5]==s[5:6]):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
s = input()
if(s[2]==s[3] and s[4]==s[5]){print("Yes")}
else{print("No")}

Fixed submission:
s = input()
if(s[2:3]==s[3:4] and s[4:5]==s[5:6]):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
c=list(range(1,n+1))
num=list(map(lambda t:reduce(lambda a,b:a+1 if b==t else a,a,0),c))
preans=reduce(lambda x,y:x+y*(y-1)/2,num,0)
for i in range(n):
    print(int(preans-num[a[i]-1]+1))

Fixed submission:
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
c=list(range(1,n+1))
num=[0]*n
for i in range(n):
    num[a[i]-1]=num[a[i]-1]+1
preans=reduce(lambda x,y:x+y*(y-1)/2,num,0)

for i in range(n):
    print(int(preans-num[a[i]-1]+1))

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
c=list(range(1,n+1))
num=list(map(lambda t:reduce(lambda a,b:a+1 if b==t else a,a,0),c))
"""
test=list(map(lambda t:map(lambda x,y:x if (y!=t or x==0) else x-1,num,c),c))
for i in range(5):
    print(list(test[i]))
"""
preans=reduce(lambda x,y:x+y*(y-1)/2,num,0)

for i in range(n):
    print(int(preans-num[a[i]-1]+1))

Fixed submission:
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
c=list(range(1,n+1))
num=[0]*n
for i in range(n):
    num[a[i]-1]=num[a[i]-1]+1
preans=reduce(lambda x,y:x+y*(y-1)/2,num,0)

for i in range(n):
    print(int(preans-num[a[i]-1]+1))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if(a=1 or b=1):
  print(1)
else:
  print(int((a*b)/2)+(a*b)%2)

Fixed submission:
a,b=map(int,input().split())
if(a==1 or b==1):
  print(1)
else:
  print(int((a*b)/2)+(a*b)%2)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=1.08
d=int(a/b)
d=d-1
hoge=0
for i in range(4):
  if(int(d*c)==a and hoge==0)
    print(a)
    hoge=1
  d=d+1
if(hoge==0):
  print(":(")

Fixed submission:
a=int(input())
b=1.08
d=int(a/b)
d=d-1
hoge=0
for i in range(4):
  if(int(d*b)==a and hoge==0):
    print(d)
    hoge=1
  d=d+1
if(hoge==0):
  print(":(")
Buggy python submission (verdict: Runtime Error):
n,in,out=map(int,input().split())
b=input()
kokunai=0
kaigai=0
for i in range(n):
  if(b[i]=='c'):
    print('No')
  else if(b[i]=='a'):
    if(kokunai+kaigai>=in+out):
      print('No')
    else:
      kokunai=kokunai+1
      print('Yes')
  else:
    if(kokunai+kaigai>=in+put or kaigai>=out):
      print('No')
    else:
      print('Yes')

Fixed submission:
n,nai,out=map(int,input().split())
b=input()
kokunai=0
kaigai=0
for i in range(n):
  if(b[i]=='c'):
    print('No')
  elif(b[i]=='a'):
    if(kokunai+kaigai>=nai+out):
      print('No')
    else:
      kokunai=kokunai+1
      print('Yes')
  else:
    if(kokunai+kaigai>=nai+out or kaigai>=out):
      print('No')
    else:
      print('Yes')
      kaigai=kaigai+1
Buggy python submission (verdict: Runtime Error):
n,k = map(int , input().split())
l = tuple(map(int , input().split()))
if(k < n):
    dp = [0]*n
    dp[0] = 0
    dp[1] = abs(l[1]-l[0])
    if(n > 2):
        for i in range(2,n):
            min1 = 0
            #print(min1,i)
            for j in range(1,k+1):
                #print(i-j)
                if(i-j >= 0):
                    if(min1 == 0):
                        min1 = dp[i-j]+abs(l[i]-l[i-j])
                        #print(min1,dp[i-j],i-j)
                    else:
                        min1 = min(min1,dp[i-j]+abs(l[i]-l[i-j]))
                        #print(min1)
                else:
                    break
            dp[i] = min1
            #print(dp[i],i)
    
    #print(*dp)
    print(dp[-1])
else:
    print("0")

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
dp = [0 for i in range(n)]
dp[1] = abs(l[1]-l[0])
for i in range(2,n):
    dp[i] = min(dp[i-1] + abs(l[i]-l[i-1]),dp[i-2]+abs(l[i]-l[i-2]))
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
s=input()
if s.isupper(){
  print("A")}else{
  print("a")}
  

Fixed submission:
s = input()
if s.isupper():
  print("A")
else:
  print("a")
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
p = list(map(int,input().split)
p.sort(reverse = True)
print(sum(p[:K]))

Fixed submission:
N,K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
print(sum(p[:K]))