ZhenlongDai/ACPR huggingface dataset:
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m, d = map(int, input().split())
m_l = list(range(1, m+1))
ans = 0
if d < 10:
  print(0)
  exit()
for i in range(10, d):
  a, b = map(int, str(i))
  if a * b in m_l and a >= 2 and b >= 2:
    ans += 1

print(ans)

Failing test case input:
26 28

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
m, d = map(int, input().split())
ans = 0
if d < 10:
  print(0)
  exit()
for i in range(10, d+1):
  a, b = map(int, str(i))
  if a * b <= m and a >= 2 and b >= 2:
    ans += 1

print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d=map(int, input().split())
ans=0
for i in range(4,m+1):
    for j in range(22,d+1):
        if int(str(j)[0])*int(str(j)[1])==i:
            ans+=1
print(ans)

Failing test case input:
9 48

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
m,d=map(int, input().split())
ans=0
if d<=21:
    print(0)
else:
    for i in range(1,m+1):
        for j in range(22,d+1):
            if int(str(j)[0])*int(str(j)[1])==i and int(str(j)[1])>=2:
                ans+=1
    print(ans)

Problem: p02927
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(20, d + 1):
        if i == int(str(j)[0]) * int(str(j)[1]):
            ans += 1
print(ans)


Failing test case input:
22 79

Expected output:
25


Actual output:
29


Fixed submission (verdict: Accepted):
m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(22, d + 1):
        if str(j)[0] != "1" and str(j)[1] != "1":
            if i == int(str(j)[0]) * int(str(j)[1]):
                ans += 1
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d=input().split()
m,d=int(m),int(d)

c=0
if d<22:
    print(0)
else:
    for j in range(m):
        for i in range(d-22):
            d1,d10=int(str(i+22)[1]),int(str(i+22)[0])
            
            
            if d1>1 and d10>1 and d1*d10==j+1:
                c+=1
                
    print(c)


Failing test case input:
19 28

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
m,d=input().split()
m,d=int(m),int(d)

c=0
if d<22:
    print(0)
else:
    for j in range(m):
        for i in range(d-21):
            d1,d10=int(str(i+22)[1]),int(str(i+22)[0])
            
            
            if d1>1 and d10>1 and d1*d10==j+1:
                c+=1
                
    print(c)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        if len(str(d)) == 1:
            continue
        else:
            d1 = int(str(d)[0])
            d2 = int(str(d)[1])
            if d1*d2 == m and d1 >= 2 and d2 >= 2:
                ans += 1
                print(m, d1*d2, d1, d2)
print(ans)

Failing test case input:
16 94

Expected output:
19


Actual output:
4 4 2 2
6 6 2 3
6 6 3 2
8 8 2 4
8 8 4 2
9 9 3 3
10 10 2 5
10 10 5 2
12 12 2 6
12 12 3 4
12 12 4 3
12 12 6 2
14 14 2 7
14 14 7 2
15 15 3 5
15 15 5 3
16 16 2 8
16 16 4 4
16 16 8 2
19


Fixed submission (verdict: Accepted):

M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        if len(str(d)) == 1:
            continue
        else:
            d1 = int(str(d)[0])
            d2 = int(str(d)[1])
            if d1*d2 == m and d1 >= 2 and d2 >= 2:
                ans += 1
print(ans)

Problem: p02927
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(22, d + 1):
        if i == int(str(j)[0]) * int(str(j)[1]):
            ans += 1
print(ans)



Failing test case input:
12 44

Expected output:
10


Actual output:
11


Fixed submission (verdict: Accepted):
m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(22, d + 1):
        if str(j)[0] != "1" and str(j)[1] != "1":
            if i == int(str(j)[0]) * int(str(j)[1]):
                ans += 1
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int,input().split())
f = []
d1,d10,cout = 0,0,0
for i in range(m):
  for j in range(d):
    if j+1 >= 10:
      f = list(str(j+1))
      d10 = int(f[0])
      d1 = int(f[1])
    if d1 >=2 and d10 >= 2:
      if d1*d10 == i+1:
        cout += 1
print(cout)

Failing test case input:
12 32

Expected output:
6


Actual output:
15


Fixed submission (verdict: Accepted):
m,d = map(int,input().split())
f = []
d1,d10,cout = 0,0,0
for i in range(m):
  for j in range(d):
    if j+1 >= 10:
      f = list(str(j+1))
      d10 = int(f[0])
      d1 = int(f[1])
    if d1 >=2 and d10 >= 2:
      if d1*d10 == i+1:
        cout += 1
  d10,d1 = 0,0
print(cout)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math



m,d=map(int,input().split())



mySet=list()



for i in range(22,d+1):
	res=(i/10)*(i%10)

	if res<=m:
		mySet.append(res)




print(len(mySet))

Failing test case input:
1 69

Expected output:
0


Actual output:
4


Fixed submission (verdict: Accepted):

import math



m,d=map(int,input().split())



mySet=list()



for i in range(22,d+1):
	res=int(i/10)*(i%10)
	x=int(i/10)

	 
	if res<=m and x>1 and (i%10)>1:
		mySet.append(res)

		




print(len(mySet))
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m , d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(22, d+1):
        d10 = int(str(n)[0])
        d1 = int(str(n)[1])
        if d10 * d1 == i:
            ans +=1
print(ans)

Failing test case input:
12 51

Expected output:
10


Actual output:
12


Fixed submission (verdict: Accepted):
m , d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(10, d+1):
        d10 = int(str(n)[0])
        d1 = int(str(n)[1])
        if d1 >= 2 and d10 >= 2:
            if d10 * d1 == i:
                ans +=1
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int, input().split())
c = 0
for i in range(1,m+1):
  for j in range(22,d+1):
    a = int(str(j)[0])
    b = int(str(j)[1])
    if a*b == i:
      c += 1
print(c)

Failing test case input:
15 38

Expected output:
10


Actual output:
11


Fixed submission (verdict: Accepted):
m,d = map(int, input().split())
c = 0
for i in range(1,m+1):
  for j in range(22,d+1):
    a = int(str(j)[0])
    b = int(str(j)[1])
    if a*b == i and a > 1 and b > 1:
      
      c += 1
print(c)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  M,D = map(int,input().split())
  if D < 22:
      print(0)
      return
  cnt = 0
  for i in range(D):
      if 1 < (D/10) and 1 < (D%10) and (D/10)*(D%10) <= M:
          cnt += 1
  print(cnt)
  
main()

Failing test case input:
12 31

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
import math
def main():
  M,D = map(int,input().split())
  if D < 22:
       print(0)
       return
  cnt = 0
  for i in range(D + 1):
      if 2 <= (i/10) and 2 <= (i%10) and math.floor(i/10)*(i%10) <= M:
          cnt += 1
  print(cnt)
  
main()

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d=map(int,input().split())

a=0
if d>=22:
    for i in range(d-21):
        day=d-i
        d1=int(str(day)[1])
        d10=int(str(day)[0])
        if int(str(day)[1])!=1:
            if d1*d10<=m and d1!=0:
                print(d10,d1)
                a+=1

print(a)


Failing test case input:
12 51

Expected output:
10


Actual output:
4 3
4 2
3 4
3 3
3 2
2 6
2 5
2 4
2 3
2 2
10


Fixed submission (verdict: Accepted):
m,d=map(int,input().split())

a=0
if d>=22:
    for i in range(d-21):
        day=d-i
        d1=int(str(day)[1])
        d10=int(str(day)[0])
        if int(str(day)[1])!=1:
            if d1*d10<=m and d1!=0:
                
                a+=1

print(a)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b = map(int, input().split())
ans = 0

for i in range(a+1):
  for j in range(b+1):
    if len(str(j)) == 2 and i >= 2 and int(str(j)[1]) >= 2 and int(str(j)[0]) >= 2:
      if i == int(str(j)[0]) * int(str(j)[1]): 
        print(str(i) +' '+ str(j))
        ans += 1

print(ans)

Failing test case input:
12 48

Expected output:
10


Actual output:
4 22
6 23
6 32
8 24
8 42
9 33
10 25
12 26
12 34
12 43
10


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

ans = 0

for i in range(a+1):
  for j in range(b+1):
    if len(str(j)) == 2 and i >= 2 and int(str(j)[1]) >= 2 and int(str(j)[0]) >= 2:
      if i == int(str(j)[0]) * int(str(j)[1]): 
        ans += 1

print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M,D = list(map(int, input().strip().split()))
count = 0
for m in range(2,M+1):
    for d in range(11, D+1):
        if ((d%10) >= 2) and (int(d/10) >= 2) and (m == int(d/10) * (d%10)):
            print(m,d)
print(count)


Failing test case input:
18 58

Expected output:
18


Actual output:
4 22
6 23
6 32
8 24
8 42
9 33
10 25
10 52
12 26
12 34
12 43
14 27
15 35
15 53
16 28
16 44
18 29
18 36
0


Fixed submission (verdict: Accepted):
M,D = list(map(int, input().strip().split()))
count = 0
for m in range(2,M+1):
    for d in range(11, D+1):
        if ((d%10) >= 2) and (int(d/10) >= 2) and (m == int(d/10) * (d%10)):
            count+=1
print(count)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M, D = map(int, input().split())
ans = 0
for m in range(4, M+1):
    for d in range(22, D+1):
        d = str(d)
        d_10, d_1 = int(d[0]), int(d[1])
        if d_10 * d_1 == m:
            ans += 1

print(ans)

Failing test case input:
18 58

Expected output:
18


Actual output:
20


Fixed submission (verdict: Accepted):
M, D = map(int, input().split())
ans = 0
for m in range(4, M+1):
    for d in range(22, D+1):
        d = str(d)
        d_10, d_1 = int(d[0]), int(d[1])
        if d_10 < 2 or d_1 < 2:
            continue
        if d_10 * d_1 == m:
            ans += 1

print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  M,D = map(int,input().split())
  if D < 22:
      print(0)
      return
  cnt = 0
  for i in range(D):
      if 1 < (D/10) and 1 < (D%10) and (D/10)*(D%10) < M:
          cnt += 1
  print(cnt)
  
main()

Failing test case input:
16 57

Expected output:
16


Actual output:
0


Fixed submission (verdict: Accepted):
import math
def main():
  M,D = map(int,input().split())
  if D < 22:
       print(0)
       return
  cnt = 0
  for i in range(D + 1):
      if 2 <= (i/10) and 2 <= (i%10) and math.floor(i/10)*(i%10) <= M:
          cnt += 1
  print(cnt)
  
main()
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d=map(int,input().split())
x=0
if m>=4 and d>=22:
  for i in range(4,m+1):
    for j in range(22,d+1):
      if int(str(j)[1])*int(str(j)[0])==i:
        x+=1
print(x)

Failing test case input:
18 58

Expected output:
18


Actual output:
20


Fixed submission (verdict: Accepted):
m,d=map(int,input().split())
x=0
if m>=4 and d>=22:
  for i in range(4,m+1):
    for j in range(22,d+1):
      if j%10>1 and int(str(j)[1])*int(str(j)[0])==i:
        x+=1
print(x)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int,input().split())

ans = 0;

if(d >= 22):
  for i in range(1,m+1):
    for j in range(20,d):
      d1 = j%10
      d10 = int(j/10)
      if(d1 >= 2 and i == d1*d10):
        ans += 1

print(ans)

Failing test case input:
12 25

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
m,d = map(int,input().split())

ans = 0;

if(d >= 22):
  for i in range(1,m+1):
    for j in range(20,d+1):
      d1 = j%10
      d10 = int(j/10)
      if(d1 >= 2 and d10 >= 2 and i == d1*d10):
        ans += 1

print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  M,D = map(int,input().split())
  if D < 22:
      print(0)
      return
  cnt = 0
  for i in range(D):
      if (D/10)*(D%10) <= M:
          cnt += 1
  print(cnt)
  
main()

Failing test case input:
31 48

Expected output:
22


Actual output:
0


Fixed submission (verdict: Accepted):
import math
def main():
  M,D = map(int,input().split())
  if D < 22:
       print(0)
       return
  cnt = 0
  for i in range(D + 1):
      if 2 <= (i/10) and 2 <= (i%10) and math.floor(i/10)*(i%10) <= M:
          cnt += 1
  print(cnt)
  
main()

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def calendar():
    m, d = map(int, input().split())
    res = []
 
    for month in range(1, m + 1):
        for day in range(2, 10):
            for x in range(2, 10):
                if x * day == month:
                    temp = str(day) + str(x)
                    temp = int(temp)
                    if temp <= d:
                        res.append(temp)
    return len(res)
 
 
calendar()

Failing test case input:
12 60

Expected output:
11


Actual output:

Fixed submission (verdict: Accepted):
def calendar():
    m, d = map(int, input().split())
    res = []
 
    for month in range(1, m + 1):
        for day in range(2, 10):
            for x in range(2, 10):
                if x * day == month:
                    temp = str(day) + str(x)
                    temp = int(temp)
                    if temp <= d:
                        res.append(temp)
    return len(res)
 
 
print(calendar())
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
d = input().split()
ans = []
cnt = 0
for day in range(int(d[1])):
    if (day >= 22):
        if (int(str(day)[0]) >=2 and int(str(day)[1]) >=2 ):
            ans.append(int(str(day)[0]) * int(str(day)[1]))
for date in range(2, int(d[0])+1):
    cnt = cnt + ans.count(date)
print(cnt)

Failing test case input:
12 25

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
d = input().split()
ans = []
cnt = 0
for day in range(int(d[1])+1):
    if (day >= 22):
        if (int(str(day)[0]) >=2 and int(str(day)[1]) >=2 ):
            ans.append(int(str(day)[0]) * int(str(day)[1]))
for date in range(2, int(d[0])+1):
    cnt = cnt + ans.count(date)
print(cnt)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M,D = map(int,input().split(' '))
if M <= 3 or D <= 21:
  print(0)
  exit()
num = 0
for m in range(4,M+1):
  for d in range(21,D+1):
    X = str(d)
    if int(X[0]) * int(X[1]) == m:
      num += 1
print(num)

Failing test case input:
6 42

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
M,D = map(int,input().split(' '))
if M <= 3 or D <= 21:
  print(0)
  exit()
num = 0
for m in range(4,M+1):
  for d in range(21,D+1):
    X = str(d)
    if int(X[1]) <= 1:
      pass
    elif int(X[0]) * int(X[1]) == m:
      num += 1
print(num)

Problem: p02927
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
m,d=map(int,input().split())
M=[i for i in range(4,m+1)]
if d<22:
	print(0)
else:
	c=0
	for i in range(22,d+1):
		d10=int(str(i)[0])
		d1=int(str(i)[1])
		if d10 * d1 in M:
			c+=1
	print(c)

Failing test case input:
12 48

Expected output:
10


Actual output:
11


Fixed submission (verdict: Accepted):
m,d=map(int,input().split())
c=0
for i in range(1,m+1):
	for j in range(1,d+1):
		if j>=10:
			d10=int(str(j)[0])
			d1=int(str(j)[1])
			if d10>1 and d1>1:
				if i==d10*d1:
					
					c+=1
print(c)

Problem: p02927
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
months, d = map(int, input().split())

ans_count = 0

for month in range(4, months + 1):
    for i in range(1, d + 1):
        if i <= 9:
            continue

        a, b = map(int, str(i))

        if (a or b) <= 1:
            continue

        if a * b == month:
            ans_count += 1

print(ans_count)

Failing test case input:
9 48

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
months, d = map(int, input().split())

ans_count = 0

for month in range(4, months + 1):
    for i in range(1, d + 1):
        if i <= 9:
            continue

        a, b = map(int, str(i))

        if a >= 2 and b >= 2 and a * b == month:
            ans_count += 1

print(ans_count)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M, D = map(int, input().split())
c = 0
for m in range(1,M+1):
  for d in range(22, D):
    dl = list(str(d))
    if int(dl[0]) != 0 and int(dl[0]) != 1 and int(dl[1]) != 0 and int(dl[1]) != 1:
      if int(dl[0]) * int(dl[1]) == m:
        c += 1
      
print(c)

Failing test case input:
12 25

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
M, D = map(int, input().split())
c = 0
for m in range(1,M+1):
  for d in range(22, D+1):
    dl = list(str(d))
    if int(dl[0]) != 0 and int(dl[0]) != 1 and int(dl[1]) != 0 and int(dl[1]) != 1:
      if int(dl[0]) * int(dl[1]) == m:
        c += 1
      
print(c)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d=map(int,input().split())
ans=0
for i in range(22,d):
    s=list(str(i))
    d1=int(s[0])
    d2=int(s[1])
    if d1<2 or d2 <2:
        continue

    for j in range(1,m+1):
        if d1*d2==j:
            ans+=1
            
print(ans)

Failing test case input:
19 28

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
m,d=map(int,input().split())
ans=0
for i in range(22,d+1):
    s=list(str(i))
    d1=int(s[0])
    d2=int(s[1])
    if d1<2 or d2 <2:
        continue

    for j in range(1,m+1):
        if d1*d2==j:
            ans+=1
            

print(ans)

Problem: p02927
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
m,d = map(int,input().split())
ans = 0
for m in range(4,m+1):
  for i in range(22,d+1):
    d0 = i%10
    d1 = int(i/10)
    if m == d0 * d1:
      ans += 1
print(ans)

Failing test case input:
22 79

Expected output:
25


Actual output:
29


Fixed submission (verdict: Accepted):
m,d = map(int,input().split())
ans = 0
for i in range(22,d+1):
  d0 = i%10
  d1 = int(i/10)
  if d0 == 1 or d0 == 0:
    continue
  if m >= d0 * d1:
    ans += 1
    
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int, input().split())

ans = 0
for month in range(4, m):
  for day in range(22, d):
    sday = str(day)
    if int(sday[1]) < 2:
      continue
    if int(sday[0]) * int(sday[1]) == month:
      ans += 1

print(ans)

Failing test case input:
12 31

Expected output:
5

Actual output:
4


Fixed submission (verdict: Accepted):
m,d = map(int, input().split())

ans = 0
for month in range(4, m+1):
  for day in range(22, d+1):
    sday = str(day)
    if int(sday[1]) < 2:
      continue
    if int(sday[0]) * int(sday[1]) == month:
      ans += 1

print(ans)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def main():
    M, D = map(int, input().split())
    count = 0
    for month in range(4,M+1):
        for day in range(20,D+1):
            d10 = int(day / 10)
            d = day - d10 * 10
            if d * d10 == month:
                count += 1
    print(count)


if __name__ == "__main__":
    main()


Failing test case input:
12 94

Expected output:
12


Actual output:
18


Fixed submission (verdict: Accepted):


def main():
    M, D = map(int, input().split())
    count = 0
    for month in range(4,M+1):
        for day in range(20,D+1):
            d10 = int(day / 10)
            d = day - d10 * 10
            if d >= 2 and d * d10 == month:
                count += 1
    print(count)


if __name__ == "__main__":
    main()

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m ,d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(22,d+1):
        if n >= 10:
            if i == int(str(n)[0]) * int(str(n)[-1]):
                ans += 1
print(ans)

Failing test case input:
9 66

Expected output:
6


Actual output:
9


Fixed submission (verdict: Accepted):
m , d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(10, d+1):
        d10 = int(str(n)[0])
        d1 = int(str(n)[1])
        if d1 >= 2 and d10 >= 2:
            if d10 * d1 == i:
                ans +=1
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int,input().split())
if d<21:
    print(0)

cnt=0
for i in range(1,m+1):
    for j in range(22,d+1):
        d10,d1=divmod(j, 10)
        if d1>=2 and i==d1*d10:
            cnt = cnt+1
print(cnt)

Failing test case input:
26 15

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
import sys
m,d = map(int,input().split())
if d<21:
    print(0)
    sys.exit()
cnt=0
for i in range(1,m+1):
    for j in range(22,d+1):
        d10,d1=divmod(j, 10)
        if d1>=2 and i==d1*d10:
            cnt = cnt+1
print(cnt)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int,input().split())
result = 0
if d <= 21:
    print(0)
    exit()
else:
    for month in range(4,m+1):
        for day in range(22,d+1):
            d10 = int(str(day)[0])
            d1 = int(str(day)[1])
            if month == d10*d1:
                result += 1
    print(result)

Failing test case input:
18 58

Expected output:
18


Actual output:
20


Fixed submission (verdict: Accepted):
m,d = map(int,input().split())
result = 0
if d <= 21:
    print(0)
    exit()
else:
    for month in range(4,m+1):
        for day in range(22,d+1):
            d10 = int(str(day)[0])
            d1 = int(str(day)[1])
            if d1 >= 2 and d10 >= 2:
                if month == d10*d1:
                    result += 1
    print(result)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M,D = map(int, input().split())
if M < 4 or D < 22:
    print(0);exit()
result=0
for m in range(4,M+1):
    for d in range(22,D+1):
        if int(str(d)[0])*int(str(d)[1])==m:
            result += 1
print(result)

Failing test case input:
24 94

Expected output:
31


Actual output:
37


Fixed submission (verdict: Accepted):
M,D = map(int, input().split())
if M < 4 or D < 22:
    print(0)
else:
    result=0
    for m in range(4,M+1):
        for d in range(22,D+1):
            if int(str(d)[0]) >= 2 and int(str(d)[1]) >= 2 and int(str(d)[0])*int(str(d)[1])==m:
                result += 1
    print(result)

Problem: p02927
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
M, d = input().split()
if int(d)>=10:
  d10 = int(d[0])
  d1 = int(d[1])
else:
  print(0)
  sys.exit()
M = int(M)
ans = 0
for j in range(2,d10+1):
  for i in range(2,10):
    if 10*j+i>d10*10+d1:
      print(ans)
      sys.exit()
    if M >=j*i:
      ans+=1

Failing test case input:
12 39

Expected output:
8


Actual output:

Fixed submission (verdict: Accepted):
import sys
M, d = input().split()
if int(d)>=10:
  d10 = int(d[0])
  d1 = int(d[1])
else:
  print(0)
  sys.exit()
M = int(M)
ans = 0
for j in range(2,d10+1):
  for i in range(2,10):
    if 10*j+i>d10*10+d1:
      print(ans)
      sys.exit()
    if M >=j*i:
      ans+=1
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
dg = input().split()
m = int(dg[0])
d = int(dg[1])
count = 0
for i in range(m + 1):
    if i !=0:
        for e in range(d):
            if(len(str(e)) >= 2):
                ee = str(e)
                d1 = int(ee[0])
                d2 = int(ee[1])
                
                if d1*d2 == i and d1 >=2 and d2>=2:
                    count = count +1

                    
                    
print(count)

Failing test case input:
19 28

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
dg = input().split()
m = int(dg[0])
d = int(dg[1])
count = 0
for i in range(m + 1):
    if i !=0:
        for e in range(d + 1):
            if(len(str(e)) >= 2):
                ee = str(e)
                d1 = int(ee[0])
                d2 = int(ee[1])
                
                if d1*d2 == i and d1 >=2 and d2>=2:
                    count = count +1

                    
                    
print(count)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


if __name__ == '__main__':
    M, D = map(int, input().split())
    
    

    count = 0
    for m in range(1,M+1):
        for d in range(1,D+1):
            if d>=10:
                d_ = str(d)
                D10 = int(d_[0])
                D1 = int(d_[1])
                D_ = D10 * D1
                if m == D_ and D10>=2 and D1>=2:
                    print(d_,m)
                    count += 1
                else:
                    D_ = 0

    print(count)


Failing test case input:
12 60

Expected output:
11


Actual output:
22 4
23 6
32 6
24 8
42 8
33 9
25 10
52 10
26 12
34 12
43 12
11


Fixed submission (verdict: Accepted):


if __name__ == '__main__':
    M, D = map(int, input().split())
    
    

    count = 0
    for m in range(1,M+1):
        for d in range(1,D+1):
            if d>=10:
                d_ = str(d)
                D10 = int(d_[0])
                D1 = int(d_[1])
                D_ = D10 * D1
                if m == D_ and D10>=2 and D1>=2:
                    count += 1
                else:
                    D_ = 0

    print(count)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
month, day = input().split(" ")
month = int(month)
day = int(day)

num_d = 0
for m in range(2,month+1):
    for i in range(2,10):
        if m%i==0:
            d1 = m
            if i*10+d1 <= day and d1>1:
                num_d += 1

print(num_d)

Failing test case input:
9 66

Expected output:
6


Actual output:
11


Fixed submission (verdict: Accepted):
month, day = input().split(" ")
month = int(month)
day = int(day)

num_d = 0
for m in range(2,month+1):
    for d10 in range(2,10):
        for d1 in range(2,10):
            if d10*d1 == m and d10*10+d1 <= day:
                num_d += 1

print(num_d)

Problem: p02927
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
m,d=map(int,input().split())
if d<=21:print(0)
elif m<=3:print(0)
else:
  cnt=0
  for i in range(4,m+1):
    for j in range(22,d+1):
      if i==int(str(j)[0])*int(str(j)[1]):
        cnt+=1
  print(cnt)

Failing test case input:
16 94

Expected output:
19


Actual output:
25


Fixed submission (verdict: Accepted):
m,d=map(int,input().split())
if d<=21:print(0)
elif m<=3:print(0)
else:
  cnt=0
  for i in range(4,m+1):
    for j in range(22,d+1):
      if j%10<=1:continue
      if i==int(str(j)[0])*int(str(j)[1]):
        cnt+=1
  print(cnt)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m, d = map(int, input().split())
count = 0
if d < 22:
  pass
else:
  for n in range(1, m+1): 
    for i in range(22, d):
      a, b = list(str(i))
      a = int(a)
      b = int(b)
      if n == a * b and a >= 2 and b >= 2:
        count += 1
print(count)

Failing test case input:
19 28

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
m, d = map(int, input().split())
count = 0
if d < 22:
  pass
else:
  for n in range(1, m+1): 
    for i in range(10, d+1):
      a, b = list(str(i))
      a = int(a)
      b = int(b)
      if n == a * b and a >= 2 and b >= 2:
        count += 1
print(count)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m, d = map(int, input().split())
if m < 4 or d < 22:
  print("0")
else:
  res=0
  for i in range(22, d+1):
    d1, d2 = int(i/10), i%10
    res += 1 if 4<=d1*d2<=m else 0
  print(res)

Failing test case input:
9 66

Expected output:
6


Actual output:
9


Fixed submission (verdict: Accepted):
m, d = map(int, input().split())
if m < 4 or d < 22:
  print("0")
else:
  res=0
  for i in range(22, d+1):
    d1, d2 = int(i/10), i%10
    if d2 < 2:
      continue
    res += 1 if d1*d2<=m else 0
  print(res)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
month, day = input().split(" ")
month = int(month)
day = int(day)

num_d = 0
for m in range(1,month+1):
    for i in range(2,10):
        if i*10 > day:
            continue
        if m%i==0:
            d1 = m
            if i*10+d1 <= day and d1>1:
                num_d += 1

print(num_d)

Failing test case input:
12 39

Expected output:
8


Actual output:
9


Fixed submission (verdict: Accepted):
month, day = input().split(" ")
month = int(month)
day = int(day)

num_d = 0
for m in range(2,month+1):
    for d10 in range(2,10):
        for d1 in range(2,10):
            if d10*d1 == m and d10*10+d1 <= day:
                num_d += 1

print(num_d)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m ,d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(22,d+1):
        if i == int(str(n)[0]) * int(str(n)[-1]):
            ans += 1
print(ans)

Failing test case input:
24 94

Expected output:
31


Actual output:
37


Fixed submission (verdict: Accepted):
m , d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(10, d+1):
        d10 = int(str(n)[0])
        d1 = int(str(n)[1])
        if d1 >= 2 and d10 >= 2:
            if d10 * d1 == i:
                ans +=1
print(ans)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M,D=map(int,input().split())
if D<21:
        print('0')
else:
        ans=0
        for i in range(22,D):
                d10=int(str(i)[0])
                d1=int(str(i)[1])
                if d10<2 or d1<2:
                        pass
                else:
                        if d10*d1<=M:
                                ans+=1
        print(ans)



Failing test case input:
19 28

Expected output:
7


Actual output:
6


Fixed submission (verdict: Accepted):
M,D=map(int,input().split())
if D<21:
        print('0')
else:
        ans=0
        for i in range(22,D+1):
                d10=int(str(i)[0])
                d1=int(str(i)[1])
                if d10<2 or d1<2:
                        pass
                else:
                        if d10*d1<=M:
                                ans+=1
        print(ans)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
MD = [int(i) for i in input().split()]

c = 0
for m in range(1, MD[0] + 1):
    for d in range(1, MD[1] + 1):
        if d < 22:
            continue
        d1  = d % 10
        d10 = (d - d1) /10


        if m == d1 * d10:
            
            c+=1

print(c -1 )

Failing test case input:
16 57

Expected output:
16


Actual output:
18


Fixed submission (verdict: Accepted):
MD = [int(i) for i in input().split()]

c = 0
for m in range(1, MD[0] + 1):
    for d in range(1, MD[1] + 1):
        
        d1  = d % 10
        d10 = (d - d1) /10
        if d1 < 2 or d10 <2:
            continue

        if m == d1 * d10:
            
            c+=1

print(c  )

Problem: p02927
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
M,D = map(int, input().split())
count = 0
for month in range(4, M+1):
    if len(str(D)) == 2:
        for day in range(22,D+1):
            if int(str(day)[0]) * int(str(day)[1]) == month:
                count += 1
print(count)



Failing test case input:
24 51

Expected output:
20


Actual output:
22


Fixed submission (verdict: Accepted):
M,D = map(int, input().split())
count = 0

for month in range(4, M+1):
    if len(str(D)) == 2:
        for day in range(22,D+1):
            if int(str(day)[0]) >= 2 and int(str(day)[1]) >= 2:
                if int(str(day)[0]) * int(str(day)[1]) == month:
                    count += 1

print(count)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m,d = map(int,input().split())
D=["",""]
if d<21:
    print(0)

cnt=0
for i in range(1,m+1):
    for j in range(22,d+1):
        d10,d1=divmod(j, 10)
        if d1>=2 and i==d1*d10:
            cnt = cnt+1
print(cnt)

Failing test case input:
26 15

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
import sys
m,d = map(int,input().split())
if d<21:
    print(0)
    sys.exit()
cnt=0
for i in range(1,m+1):
    for j in range(22,d+1):
        d10,d1=divmod(j, 10)
        if d1>=2 and i==d1*d10:
            cnt = cnt+1
print(cnt)

Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
M,D = list(map(int, input().split()))
ans = 0
if M >=4:
    for i in range(4, M+1):
        if D >= 22:
            for j in range(22, D+1):
                if i == int(j/10) * int(j%10):
                    ans += 1
                    
print(ans)
    

Failing test case input:
16 59

Expected output:
16


Actual output:
18


Fixed submission (verdict: Accepted):
M,D = list(map(int, input().split()))
ans = 0
if M >=4:
    for i in range(4, M+1):
        if D >= 22:
            for j in range(22, D+1):
                if int(j/10) >=2 and j%10 >=2 and i == int(j/10) * int(j%10):
                    ans += 1
                    
print(ans)
Problem: p02927
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
m , d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(21, d+1):
        d10 = int(str(n)[0])
        d1 = int(str(n)[1])
        if d10 * d1 == i:
            ans +=1
print(ans)

Failing test case input:
16 59

Expected output:
16


Actual output:
18


Fixed submission (verdict: Accepted):
m , d = map(int , input().split())
ans = 0
for i in range(4,m+1):
    for n in range(10, d+1):
        d10 = int(str(n)[0])
        d1 = int(str(n)[1])
        if d1 >= 2 and d10 >= 2:
            if d10 * d1 == i:
                ans +=1
print(ans)
Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m = map(int,input().split())
h = list(map(int,input().split()))
judge = [True] * n

for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] >= h[b-1]:
        judge[b-1] = False
    else:
        judge[a-1] = False

print(judge.count(True))


Failing test case input:
6 5
8 1 9 1 2 1
1 3
3 2
4 0
4 2
4 6

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
h = list(map(int,input().split()))
judge = [True] * n

for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] == h[b-1]:
        judge[a-1],judge[b-1] =False, False
    elif h[a-1] > h[b-1]:
        judge[b-1] = False
    else:
        judge[a-1] = False

print(judge.count(True))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m = map(int,input().split())
h = list(map(int,input().split()))
c = []
for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] > h[b-1]:
        c.append(a)
    else:
        c.append(b)
print(len(set(c)))

Failing test case input:
4 3
1 3 3 5
1 3
3 4
2 4

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
h = list(map(int,input().split()))
c = [1]*n
for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] > h[b-1]:
        c[b-1] = 0
    elif h[b-1] > h[a-1]:
        c[a-1] = 0
    elif h[a-1] == h[b-1]:
        c[a-1] = c[b-1] =0
    
print(sum(c))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M = map(int,input().split())
c = [1 for _ in range(N)]
H = list(map(int,input().split()))

for i in range(M):
  a, b = map(int,input().split())
  if(H[a-1] > H[b-1]):
    c[b-1] = 0
  else:
    c[a-1] = 0
print(c.count(1))

Failing test case input:
4 2
2 4 2 5
1 3
2 1
2 4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
c = [1 for _ in range(N)]
H = list(map(int,input().split()))

for i in range(M):
  a, b = map(int,input().split())
  if(H[a-1] > H[b-1]):
    c[b-1] = 0
  elif(H[a-1] < H[b-1]):
    c[a-1] = 0
  else:
    c[a-1] = c[b-1] = 0
print(c.count(1))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m=map(int, input().split())
h = list(map(int, input().split()))
l = [input().split() for i in range(m)]

list = [0]*n
for j in range(m):
    if l[j][0] >= l[j][1]:
        list[int(l[j][1])-1] -= 1
    else :
        list[int(l[j][0])-1] -= 1

print(list.count(0))

Failing test case input:
6 5
8 6 9 1 2 1
1 3
4 0
4 3
5 6
4 6

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n,m=map(int, input().split())
h = list(map(int, input().split()))
l = [input().split() for i in range(m)]

list = [0]*n
for j in range(m):
    if h[int(l[j][0])-1] > h[int(l[j][1])-1]:
        list[int(l[j][1])-1] -= 1
    elif  h[int(l[j][0])-1] < h[int(l[j][1])-1]:
        list[int(l[j][0])-1] -= 1
    else :
        list[int(l[j][0])-1] -= 1
        list[int(l[j][1])-1] -= 1

print(list.count(0))
Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = 0
list1 = [1] * (n)
for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] > h[b - 1]:
        list1[a - 1] = 0
    else:
        list1[b - 1] = 0
print(sum(list1))

Failing test case input:
4 2
2 4 3 5
1 3
3 3
4 4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
H = [0] + list(map(int, input().split()))
O = [0] + [1] * N
for _ in range(M):
    A, B = map(int, input().split())
    if H[A] <= H[B]:
        O[A] = 0
    if H[A] >= H[B]:
        O[B] = 0
print(sum(O))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M = map(int,input().split())
H = list(map(int,input().split()))
c = [0] * N
for i in range(M):
    A,B = map(int,input().split())
    if A >= B:
        c[B - 1] += 1
    if B >= A:
        c[A - 1] += 1
print(c.count(0))

Failing test case input:
6 5
8 6 18 1 4 0
1 3
4 0
4 0
4 6
4 6

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
H = list(map(int,input().split()))
c = [0] * N
for i in range(M):
    A,B = map(int,input().split())
    if H[A -1] >= H[B -1]:
        c[B - 1] += 1
    if H[B - 1] >= H[A - 1]:
        c[A - 1] += 1
print(c.count(0))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
h = list(map(int, input().split()))
result = [1]*n

for i in range(m):
    a, b = map(int, input().split())

    if h[a-1] < h[b-1]:
        result[a-1]=0
    elif h[a-1] > h[b-1]:
        result[b-1]=0

print(sum(result))

Failing test case input:
6 5
8 6 9 1 2 1
1 3
1 1
4 0
3 3
4 6

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
h = list(map(int, input().split()))
result = [1]*n

for i in range(m):
    a, b = map(int, input().split())

    if h[a-1] < h[b-1]:
        result[a-1]=0
    elif h[a-1] > h[b-1]:
        result[b-1]=0
    else:
        result[a-1]=0
        result[b-1]=0

print(sum(result))

Problem: p02689
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]

B=[0]*N



for i in A:
    if i[0]!=i[1]:    
        B[H.index(max(H[i[0]-1],H[i[1]-1]))]=1
print(B.count(0))

Failing test case input:
4 2
2 7 3 5
1 3
3 3
0 4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]

B=[0]*N



for i in A:
    if H[i[0]-1]>H[i[1]-1]:
        B[i[1]-1]=1
    elif H[i[0]-1]<H[i[1]-1]:
        B[i[0]-1]=1
    else:
        B[i[0]-1]=1
        B[i[1]-1]=1
print(B.count(0))
Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M=map(int,input().split())

height=list(map(int,input().split()))

tower=[0]*N

for i in range(M):
    A,B=map(int,input().split())
    if height[A-1]<height[B-1]:
        tower[A-1]=1
    elif height[A-1]>height[B-1]:
        tower[B-1]=1
    
    
print(tower.count(0))

Failing test case input:
6 5
8 6 9 1 2 1
1 3
1 1
4 0
3 3
4 6

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())

height=list(map(int,input().split()))

tower=[0]*N

for i in range(M):
    A,B=map(int,input().split())
    if height[A-1]<height[B-1]:
        tower[A-1]=1
    elif height[A-1]>height[B-1]:
        tower[B-1]=1
    else:
        tower[A-1]=1
        tower[B-1]=1
    
print(tower.count(0))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m = map(int,input().split())
h = list(map(int,input().split()))
count = 0
for i in range(m):
    a,b = map(int,input().split())
    if a < b and a in h:
        h.remove(a)
    elif a > b and b in h:
        h.remove(b)

print(len(h))

Failing test case input:
4 3
1 4 3 5
1 3
3 3
2 4

Expected output:
1


Actual output:
3


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
h = list(map(int,input().split()))
H = set(range(n))
for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] <= h[b-1]:
        H.discard(a-1)
    if h[a-1] >= h[b-1]:
        H.discard(b-1)

print(len(H))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M = map(int, input().split())
H_li = list(map(int, input().split()))

par = [0 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    if H_li[B-1]>H_li[A-1]:
        par[A-1] = 1
    else:
        par[B-1] = 1

print(N-sum(par))

Failing test case input:
6 5
8 1 9 1 2 1
1 3
4 2
4 0
4 2
4 6

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
H_li = list(map(int, input().split()))

par = [0 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    if H_li[B-1]>H_li[A-1]:
        par[A-1] = 1
    elif H_li[A-1]>H_li[B-1]:
        par[B-1] = 1
    else:
        par[A-1] = 1
        par[B-1] = 1

print(N-sum(par))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,m = map(int, input().split())
h = list(map(int, input().split()))
A = [1 for i in range(n)]

for i in range(m):
    a = list(map(int, input().split()))
    
    
    if h[a[0]-1] < h[a[1]-1]:
        A[a[0]-1] = 0
    else:
        A[a[1]-1] = 0

print(sum(A))

Failing test case input:
6 5
8 6 9 1 4 1
1 3
4 0
2 0
4 6
4 6

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())
h = list(map(int, input().split()))
A = [1 for i in range(n)]

for i in range(m):
    a = list(map(int, input().split()))
    
    
    if h[a[0]-1] < h[a[1]-1]:
        A[a[0]-1] = 0
    elif h[a[0]-1] == h[a[1]-1]:
        A[a[0]-1] = 0
        A[a[1]-1] = 0
    
    else:
        A[a[1]-1] = 0

print(sum(A))
Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int, input().split())
h = list(int(i) for i in input().split())
ans = [0] * n

for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] < h[b - 1]:
        ans[a - 1] += 1
    else:
        ans[b - 1] += 1

print(ans.count(0))


Failing test case input:
4 2
2 7 2 5
1 4
3 1
2 4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
h = list(int(i) for i in input().split())
ans = [0] * n

for i in range(m):
    a, b = map(int, input().split())
    ref = []
    if h[a - 1] <= h[b - 1]:
        ref.append(a)
    if h[a - 1] >= h[b - 1]:
        ref.append(b)
    for i in ref:
        ans[i - 1] += 1
    ref.clear()


print(ans.count(0))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int,input().split())
input()
outs = [1] * N
for _ in range(K):
    a,b = map(int,input().split())
    if outs[a-1] == 0 or outs[b-1] == 0:
        continue
    else:
        outs[b-1] = 0
print(sum(outs))

Failing test case input:
6 5
8 6 9 1 4 1
1 3
4 2
4 1
4 6
4 6

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
Hs = list(map(int,input().split()))
outs = [1] * N
for _ in range(K):
    a,b = map(int,input().split())
    if Hs[a-1] == Hs[b-1]:
        outs[a-1] = 0 
        outs[b-1] = 0 
    elif Hs[a-1] > Hs[b-1]:
        outs[b-1] = 0 
    else:
        outs[a-1] = 0 
print(sum(outs))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, M= (int(x) for x in input().split())
height=[int(x) for x in input().split()]
nlist=[1]*N

for _ in range(M):
    a, b =(int(x) for x in input().split())
    a-=1
    b-=1
    if height[a]<height[b]:
        nlist[a]=0

    if height[b]<height[a]:
        nlist[b]=0

print(sum(nlist))

Failing test case input:
6 5
8 6 9 1 4 1
1 3
4 2
4 0
4 6
4 6

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N, M= (int(x) for x in input().split())
height=[int(x) for x in input().split()]
nlist=[1]*N

for _ in range(M):
    a, b =(int(x) for x in input().split())
    a-=1
    b-=1
    if height[a]<=height[b]:
        nlist[a]=0

    if height[b]<=height[a]:
        nlist[b]=0

print(sum(nlist))

Problem: p02689
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, r = map(int, input().split())
hs = list(map(int, input().split()))
g = [1]*N
for i in range(r):
    road = list(map(int, input().split()))
    if hs[road[0] - 1] > hs[road[1] - 1]:
        g[road[1] - 1] = 0
    else:
        g[road[0] - 1] = 0
print(sum(g))


Failing test case input:
6 5
13 6 9 1 2 1
1 3
1 1
4 0
3 3
4 6

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N, r = map(int, input().split())
hs = list(map(int, input().split()))
g = [1]*N
for i in range(r):
    road = list(map(int, input().split()))
    if hs[road[0] - 1] >= hs[road[1] - 1]:
        g[road[1] - 1] = 0
    if hs[road[0] - 1] <= hs[road[1] - 1]:
        g[road[0] - 1] = 0
print(sum(g))