Problem:


Score : 200 points

Problem Statement

Today is August 24, one of the five Product Days in a year.

A date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):

d_1 \geq 2

d_{10} \geq 2

d_1 \times d_{10} = m

Takahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M, and each month consists of D days from Day 1 to Day D.

In Takahashi Calendar, how many Product Days does a year have?

Constraints

All values in input are integers.

1 \leq M \leq 100

1 \leq D \leq 99

Input

Input is given from Standard Input in the following format:

M D

Output

Print the number of Product Days in a year in Takahashi Calender.

Sample Input 1

15 40

Sample Output 1

10

There are 10 Product Days in a year, as follows (m-d denotes Month m, Day d):

4-22

6-23

6-32

8-24

9-33

10-25

12-26

12-34

14-27

15-35

Sample Input 2

12 31

Sample Output 2

5

Sample Input 3

1 1

Sample Output 3

0



Sample input:
15 40


Sample output:
10

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

result = 0

if D < 22:
    print(0)
else:
    for m in range(1, M+1):
        for d in range(22, D+1):
            d1 = d%10
            d10 = d//10
            if d1 > 1 and d1*d10 == m:
                result += 1

print(result)

Submission status: Wrong Answer

Solution code:
M,D = map(int,input().split())
ans = 0
for i in range(4,M+1):
    if D<22:
        print(0)
        break
    elif M<4:
        print(0)
        break
    else:
      for j in range(22,D):
           k = str(j)
           if  int(k[0])*int(k[1]) == i:
              ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys


def main():
    m, d = [int(s) for s in sys.stdin.readline().strip().split()]

    ans = 0
    for month in range(1, m+1):
        for day in range(22, d+1):
            if (day % 10) > 1 and (day // 10) > 1:
                if (day % 10) * (day // 10) == month:
                    print(month, day)
                    ans += 1
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
M,D = map(int,input().split())
c = 0
for m in range(M+1):
    for d in range(D):
        d1 = d%10
        d10 = int((d-d1)/10)

        if d1 >= 2 and d10 >= 2 and d1*d10 == m:
            print(d1,d10)
            c+=1
print(c)

Submission status: Wrong Answer

Solution code:
m, d = map(int, input().split())
c = 0
for i in range(1, m+1):
    for j in range(1, d+1):
        d1 = j%10
        d10 = j//10
        if d1 > 1 and d10 > 1 and (d1 * d10 == i):
            print(i, j)
            c += 1
print(c)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())
cnt = 0
if(M < 4 or D < 22) :
    print(0)
else :
    for i in range(4, M + 1) :
        for j in range(22, D + 1) :
            if((j // 10) * (j % 10) == i) :
                cnt += 1
            else :
                pass
    print(cnt)

Submission status: Wrong Answer

Solution code:
def resolve():
    M,D=map(int,input().split())
    count=0
    for j in range(1,M+1):
        for i in range(D):
            if i<10: continue
            s1=int(str(i)[0])
            s2=int(str(i)[1])
            if s1>1 and s2>1:
                if s1*s2==j:
                    count+=1
    print(count)
resolve()

Submission status: Wrong Answer

Solution code:
a,b=list(map(int,input().split())),0
for i in range(a[0]):
    for j in range(a[1]):
        if len(str(j))==2:
            if int(str(j)[0])*int(str(j)[1])==i+1 and int(str(j)[0])>=2 and int(str(j)[1])>=2 :
                b+=1
print(b)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

import sys
input = sys.stdin.readline

M,D = map(int, input().split())
ans = 0
for i in range(4, M+1):
    for j in range(22, D+1):
        if int(j/10) * int(j - int(j/10)*10) == i:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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//i
            if i*10+d1 < day and d1>1:
                num_d += 1

print(num_d)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

M, D = map(int, input().split())

cand = set()
for m in range(1, M+1):
    i = 2
    while i*i <= D:
        if m % i == 0:
            ma = m//i
            mi = i
            if mi <= 1 or ma <= 1:
                pass
            elif int(str(mi)+str(ma)) <= D:
                cand.add(int(str(m)+str(mi)+str(ma)))
                print("mi,ma->", mi, ma)
            elif int(str(ma)+str(mi)) <= D:
                cand.add(int(str(m)+str(ma)+str(mi)))
                print("ma,mi->", ma, mi)

        i += 1
print(len(cand))

Submission status: Wrong Answer

Solution code:
M,D = list(map(int, input().split()))
ans = 0
for i in range(1, M+1):
    if int(D/10) >=2 and D%10 >= 2:
        for j in range(23, D+1):
            if i == int(j/10) * int(j%10):
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
m,d = map(int, input().split())
c = 0
for i in range(1,m):
  for j in range(22,d):
    a = int(str(j)[0])
    b = int(str(j)[1])
    if a*b == i:
      c += 1
print(c)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

cnt = 0
for i in range(20,D):
  d1 = i % 10
  d2 = i //10
  
  if 0 < d1*d2 <= M and d1>1 and d2>1:
#    print (i, d1*d2)
    cnt += 1

print (cnt)

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())

c = 0
for j in range(1,m+1):
    d1 = 1
    d2 = 0
    for i in range(d):
        if d1 >= 2 and d2 >= 2 and d1*d2 == j:
            c += 1
        if d1 < 10:
            d1 += 1
        else:
            d1 = 0
        if d1 == 0:
            d2 += 1
            
print(c)

Submission status: Wrong Answer

Solution code:
M,D=map(int,input().split())
ans=0
for j in range(4,M+1):
  for i in range(22,D+1):
    d1=i%10
    d10=i//10
    if d1*d10==j:
      ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
M,D=map(int,input().split())
ans=0
for i in range(1,M):
  for j in range(22,D+1):
    j=str(j)
    j1=int(j[0])
    j2=int(j[1])
    if i==j1*j2:
      ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
m, d = map(int, input().split())
count = 0
for i in range(2, 11):
    for j in range(2, 11):
        if 10 * i + j <= d and i * j <= m:
            count += 1
print(count)

Submission status: Wrong Answer

Solution code:
M, D = [int(i) for i in input().split()]
if D<10:
    print(0)
    exit()
res = 0

for m in range(M+1):
    for d in range(10,D):
        d_10 = d//10
        d_1 = d%10
        if m==(d_10 * d_1) and d_1 >= 2 and d_10 >= 2:
            res += 1

print(res)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())
count=0
 
if d<20:
  print(0)
else:
  for i in range(1,m+1):
    for j in range(20, d+1):
      a = j//10
      b = j%10
      if b>=2:
        if i == a*b:
          count+=1
 
print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
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)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())
ans = 0
for i in range(4, M + 1):
    for j in range(22, D + 1):
        d1, d2 = j % 10, j // 10
        if d1 * d2 == i:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:

M,D = map(int,input().split())

ans = 0

for m in range(M):

    m += 1

    for d in range(D):


            d10 = (d % 100) // 10
            d1  = d % 10

            if d10 >= 2 and d1 >= 2 and d10 * d1 == m:

                ans += 1

print (ans)

Submission status: Wrong Answer

Solution code:
m, d = map(int, input().split())

ans = 0
for i in range(4, m+1) :
    for j in range(22, d+1) :
        d1 = j // 10
        d2 = j % 10
        if d1 * d2 == i :
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:

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

    total = a[0]*a[1]

    count = 0
    for i in range(a[0]):
        for j in range(a[1]):
            if (j%10) >= 2 and (j//10) >= 2: 
                if (i+1) == (j%10)*(j//10):
                    count += 1

    print(count)




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# A, B = [int(i) for i in input().split(" ")]
# A = int(input())
 
M, D = [int(i) for i in input().split(" ")]
ans = 0
for i in range(1, M+1):
    for j in range(22, D+1):
        d1 = j % 10
        d2 = j // 10
        if d1 >= 2 and d2 >= 2 and d1 * d2 == i:
            ans += 1
print

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())

ans = 0
if(d > 21):
    for i in range(1,m+1):
        for j in range(22,d):
            d1 = int(str(j)[1])
            d10 = int(str(j)[0])
            if(d1 > 1):
                if (d1 * d10 == i):
                    ans+=1
                        
print(ans)

Submission status: Wrong Answer

Solution code:
m,d=map(int,input().split())
ans=chk=0
for i in range(1,m+1):
    for j in range(22,d):
        if (j%10!=1 and j//10>1 and j%10>1 and i==((j//10)*(j%10))):
            ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

result = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        if m >= 4 and d >= 22:
            d1, d10 = map(int, str(d))
            if d1 * d10 == m:
                result += 1
print(result)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

ans = 0
for m in range(1, M+1):
    for i in range(1, M+1):
        if m%i == 0 and i >= 2:
            k = m//i
            if k >= 2 and 10*i+k <= D:
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())
ans = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        if (j//10) * (j%10) == i and j//10 >= 2 and j%10 >= 2:
            print(i,j)
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
M,D = [int(zz) for zz in input().split()]

ans = 0
for i in range(M+1):
    for j in range(D):
        p = j//10
        q = j%10
        if p >= 2 and q >= 2:
            if i == p*q:
                ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
M,D = list(map(int, input().split()))
ans = 0
for i in range(1, M+1):
    if D > 22:
        for j in range(23, D+1):
            if i == int(j/10) * int(j%10):
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
M,D=map(int,input().split())

if M<4 or D<22:
	print(0)
else:
	cnt=0
	for i in range(4,M+1):
		for j in range(22,D+1):
			s=j//10
			t=j%10
			if s*t==i:cnt+=1
	print(cnt)

Submission status: Wrong Answer

Solution code:
M,D=map(int,input().split())

c=0

for i in range(4,M+1,1):
    for j in range(22,D+1,1):
        if i==(j//10)*(j%10):
            c+=1

print(c)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())
count=0

if d<20:
  print(0)
else:
  for i in range(1,m+1):
    for j in range(20, d+1):
      a = j//10
      b = j%10
      if i == a*b:
        count+=1

print(count)

Submission status: Wrong Answer

Solution code:
m,d=map(int,input().split())
ans=chk=0
for i in range(1,m+1):
    for j in range(22,d):
        if (j%10!=1 and i==((j//10)*(j%10))):

            ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split(" "))

out = 0
for d in range(2, D):
    d10 = d // 10
    d1 = d % 10
    seki = d1 * d10
    if d1 >=2 and d10 >= 2 and 1 <= seki <= M:
        out += 1

print(out)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

count = 0
for mi in range(4, M + 1):
    for di in range(2, D + 1):
        if di < 20:
            continue

        d1 = di % 10
        d10 = di // 10
        if mi == d1 * d10:
            count += 1


print(count)

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())
ans = 0
if d < 10:
    print(ans)
else:
    for month in range(1,m+1):
        for day in range(20,d):
            if int(str(day)[0])*int(str(day)[1]) == month:
                if int(str(day)[1]) >= 2:
                    ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())
count = 0
for d in range(1, D):
    d1 = d % 10
    d10 = d // 10
    if d1 < 2 or d10 < 2:
        continue
    if 1 <= d1 * d10 <= M:
        count += 1
print(count)

Submission status: Wrong Answer

Solution code:
from math import sqrt
M, D = map(int, input().split())
ans = 0
for i in range(1, M+1):
    for j in range(1, D):
        if j//10 == 1 or j%10 == 1:
            continue
        if (j//10)*(j%10) == i:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
m,d = map(int,input().split())

ans = 0

for i in range(2,m+1):
  for i in range(22,d+1):
     if m == ((d//10) * (d%10)):
        ans += 1


print(ans)

Submission status: Wrong Answer

Solution code:
m,d=map(int,input().split())
cnt=0
for j in range(1,m+1):
  for i in range(1,d+1):
    a=i//10
    b=i%10
    if a*b==j:
      cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
m, d = map(int, input().split())
ans = 0
for i in range(d):
    d1, d10 = i%10, i//10
    if d1 >= 2 and d10 >= 2:
        judge = d1 * d10
        if judge <= m:
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

ans = 0
for i in range(M):
    for j in range(D):
        month = i + 1
        day = + j
        if day//10 == 1 or day%10 == 1:
            continue
        if(month == (day//10)*(day%10)):
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:

M,D = map(int,input().split())

ans = 0

for m in range(M):

    m += 1

    for d in range(D):

        if d < 22:
            continue;

        else:

            dst = str(d)

            if int(dst[0]) >= 2 and int(dst[1]) >= 2 and int(dst[0]) * int(dst[1]) == m:

                ans += 1

print (ans)

Submission status: Wrong Answer

Solution code:
M,D = [int(zz) for zz in input().split()]

ans = 0
for i in range(4,M+1):
    for j in range(20,D):
        p = j//10
        q = j%10
        if i == p*q:
            ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
m, d = map(int, input().split())
cnt = 0
for mm in range(1, m+1):
    for dd in range(10, d):
        d1 = dd // 10
        d2 = dd % 10
        if d1 < 2 or d2 < 2:
            continue
        if mm == d1 * d2:
            cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
M, D = map(int, input().split())

res = 0

for m in range(1, M + 1):
    for d in range(1, D):
        d1 = d % 10
        d2 = d // 10

        if d1 == 1 or d2 == 1:
            continue

        if d1 * d2 == m:
            res += 1

print(res)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
count = 0

for i in range(1,m+1):
    for j in range(10,d+1):
        a = list(str(j))
        if  int(a[0]) >= 2 and int(a[1]) >= 2 and int(a[0]) * int(a[1]) == i:
            count += 1
print(count)

Submission status: Accepted

Solution code:
month,day = map(int,input().split())

def takahashi(m,d):
    if d//10<2:
        return False
    if d%10<2:
        return False

    return (d//10) * (d%10) == m

cnt=0
for m in range(1,month+1):
    for d in range(1,day+1):
        if takahashi(m,d):
            cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
cnt = 0
for i in range(4, m+1):
    for j in range(1, d+1):
        if j >= 22:
            x = j // 10
            y = j % 10
            if x >= 2 and y >= 2 and (x * y) == i:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
ans = 0
for i in range(1, D+1):
  x = i // 10
  y = i % 10
  if x > 1 and y > 1 and 1 <= x * y <= M:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
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 <= 1 or b <= 1:
            continue

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

print(ans_count)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)

def main():
    M, D = map(int, input().split())

    ans = 0
    for m in range(1, M + 1):
        for d in range(22, D + 1):
            if int(str(d)[1]) > 1 and int(str(d)[0]) * int(str(d)[1]) == m:
                ans += 1
    print(ans)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
c = 0
for i in range(22,d+1):
    if i//10*(i%10)<=m and i%10>=2:
        c+=1
print(c)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
ans = 0
for i in range(2,M+1):
    for j in range(22,D+1):
        if j % 10 == 1:
            continue
        ans += (i == (j//10) * (j%10))
print(ans)

Submission status: Accepted

Solution code:
# 第一回日本最強プログラマー学生選手権-予選-: A – Takahashi Calendar
M, D = [int(i) for i in input().split()]

seki_no_hi = 0

for m in range(1, M + 1):
    for d in range(10, D + 1):
        d1 = d % 10
        d10 = d // 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == m:
            seki_no_hi += 1

print(seki_no_hi)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    M, D = map(int, readline().split())
    ans = 0
    for m in range(1, M + 1):
        for d in range(10, D + 1):
            d_str = str(d)
            d_1 = int(d_str[1])
            d_10 = int(d_str[0])
            if d_1 >= 2 and d_10 >= 2:
                if d_1 * d_10 == m:
                    ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
  M,D=map(int,input().split())

  ans=0
  for i in range(22,D+1):
    if min(divmod(i,10)) in (0,1):
      continue
    q,r=divmod(i,10)
    if q*r <= M:
      ans += 1

  print(ans)
  
if __name__=="__main__":
  main()

Submission status: Accepted

Solution code:
m, d = map(int, input().split())

if d < 10:
    print(0)
    exit()

cnt = 0
for i in range(1,m+1):
    for j in range(10, d+1):
        t = str(j)
        if int(t[1]) >= 2 and int(t[0]) >= 2:
            if int(t[1]) * int(t[0]) == i:
                cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())

ans=0
for i in range(22,D+1):
  if min(divmod(i,10)) in (0,1):
    continue
  q,r=divmod(i,10)
  if q*r <= M:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
ans = 0
for i in range(2,m+1):
    for j in range(22,d+1):
        if j%10 == 1:
            continue
        ans += (i == (j//10)*(j%10))
print(ans)

Submission status: Accepted

Solution code:
def main():
    M, D = map(int, input().split())
    ans = 0

    for d in range(22, D + 1):
        d1 = d % 10
        d10 = d // 10

        if d1 < 2 or d10 < 2:
            continue

        if 4 <= d10 * d1 <= M:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
count = 0
for i in range(1,M+1):
  for j in range(1,D+1):
    if j >21:
      a = j//10
      b = j%10
      if i == int(a*b) and a>=2 and b>=2:
        
        count += 1
print(count)

Submission status: Accepted

Solution code:
m, d = input().split()

if len(d) == 1:
  print(0)
  exit()

result = 0

for month in range(int(m)):
  for day in range(10, int(d)):
    d_1, d_10 = map(int, str(day+1))
    if 2 <= d_1 and 2 <= d_10 and d_1 * d_10 == month+1:
      result += 1
    
print(result)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())

ans=0
for m in range(1,M+1):
    for d in range(10,D+1):
        d1,d10=d%10,d//10
        if d1*d10==m and d1>1 and d10>1:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
ans = 0
for m in range(4, M+1):
  for d in range(22, D+1):
    if d%10 < 2:
      continue
    if m == (d//10)*(d%10):
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
ans = 0
for m in range(1,M+1):
  for d in range(1,D+1):
    if (d%10)>=2 and (d//10)>=2 and (m==(d%10)*(d//10)):
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
ans = 0
for i in range(1, m + 1):
    for j in range(2, 10):
        if (i % j == 0) & (2 <= i // j <= 9) & (((i // j) * 10 + j) <= d):
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
count = 0
for i in range(21, d + 1):
    d1 = i % 10
    d10 = i // 10
    if d10 * d1 <= m and d10 >= 2 and d1 >= 2:
        count += 1
print(count)

Submission status: Accepted

Solution code:
m, d = map(int, input().split(' '))
ans = 0
for i in range(10, d + 1):
    s = str(i)
    d1 = int(s[1])
    d10 = int(s[0])
    if 2 <= d1 and 2 <= d10 and d1 * d10 <= m:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())

ans=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 d1 >= 2 and d10 >= 2 and d1*d10==i:
                ans+=1

print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
ans = 0
for i in range(1,M+1):
  for j in range(2,10):
    if i % j == 0 and 2 <= i//j < 10:
      if 10*j + i//j <= D:
        # print(i,j,i//j)
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
ans = 0
for i in range(22,d+1):
    a = i%10
    b = i//10
    if a>= 2 and b >= 2 and 0 < a*b < m+1:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
cnt = 0
for i in range(d+1):
  d10,d1 = i//10,i%10
  if d10 >= 2 and d1 >= 2 and d1 * d10 <= m:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
ans = 0
for m in range(1,M+1):
  for d in range(1,D+1):
    if (d%10)>=2 and (d//10)>=2 and (m==(d%10)*(d//10)):
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
#第一回日本最強プログラマー学生選手権-予選- a
m,d=map(int,input().split())
ans=0
for month in range(1,m+1):
    for day in range(1,d+1):
        d1=day%10
        d10=day//10
        if d1>=2 and d10>=2 and month==d1*d10:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


m,d = list(map(int, input().split()))
ans = 0
for i in range(1, m+1):
    for j in range(1, d+1):
        if j<10:
            continue
        d1 = int(str(j)[0])
        d2 = int(str(j)[1])
        if d1*d2==i and d1>=2 and d2>=2:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
M,D = map(int,input().split())
ans = 0
for i in range(1,M+1):
    for j in range(2,1+D//10):
        for k in range(2,10):
            if j*10+k > D:
                break
            if i == j*k:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
ans = 0
for i in range(1,d+1):
  if i < 22:
    continue
  else:
    if i%10 == 0:
      continue
    else:
      if i%10 == 0 or i%10 == 1:
        continue
      else:
        if (i//10)*(i%10) <= m:
          ans += 1
print(ans)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
l=list(range(1,m+1))
ans=0
for i in range(1,d+1):
    d_1=i%10
    d_10=(i-d_1)//10
    if d_1*d_10  in l and d_1!=1 and d_10!=1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    M, D = mi()
    cnt = 0

    for m in range(1, M+1):
        for d in range(1, D+1):
            if d > 9:
                d1 = int(str(d)[1])
                d10 = int(str(d)[0])

                if d1 >= 2 and d10 >= 2 and d1*d10 == m:
                    cnt += 1

    print(cnt)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

M, D = map(int, input().split())

ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        d1 = j // 10
        d2 = j % 10
        if d1 < 2 or d2 < 2:
            continue
        if d1 * d2 == i:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
a=0
for i in range(1,M+1):
    for j in range(11,D+1):
        if i==((j//10)*(j%10)) and j//10>=2 and j%10>=2:
            a+=1
print(a)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
c=0
for x in range(d+1):
    d10,d1=x//10,x%10
    if d10>=2 and d1>=2 and d10*d1<=m:c+=1
print(c)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
ans=0
for i in range(1,m+1):
    for j in range(22,d+1):
        if j%10>=2 and (j%10)*(j//10)==i:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
ans=0
for i in range(1,m+1):
  for j in range(1,d+1):
    if j//10>=2 and j%10>=2 and (j//10)*(j%10)==i:
      ans+=1
      
print(ans)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())

answer=0
for m in range(1,M+1):
  for d in range(1,D+1):
    d10=d//10
    d1=d%10    
    if d1>=2 and d10>=2 and d1*d10==m:
      answer+=1
      
print(answer)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    M, D = map(int, readline().split())
    ans = 0
    for m in range(1,M+1):
        for d in range(1,D+1):
            d = str(d)
            if len(d)==1:
                d = '0'+d
            if int(d[0])>=2 and int(d[1])>=2 and int(d[0])*int(d[1])==m:
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

m,d=nii()

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

print(ans)