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: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
m, d = readInts()
cnt = 0
for i in range(1,m+1):
    for j in range(20,d+1):
        #print(j)
        if int(str(j)[0]) >= 2 and int(str(j)[1]) >= 2 and (int(str(j)[0]) * int(str(j)[1])) == i:
            #print(i,j)
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
def solve():
  M, D = map(int, input().split())
  ans = 0
  for i in range(12,D+1):
    a,b = int(str(i)[0]),int(str(i)[1])
    if a>1 and b>1:
      if a*b<=M:
        ans += 1
  return ans
print(solve())

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

M, D = mapint()

ans = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        d = str(d)
        if len(d)!=2:
            continue
        d1 = int(d[1])
        d10 = int(d[0])
        if d1<2 or d10<2: continue
        if m==d1*d10:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

        if x == y:
            return

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

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

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

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

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

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

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

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

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

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
cnt = 0
for m in range(4,M+1):
    for d in range(1,D+1):
        if d>=20:
            d = str(d)
            if int(d[1])>=2:
                if m==int(d[0])*int(d[1]):
                    cnt += 1
print(cnt)

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):
    s=str(j)
    if int(s[1])<2:
      continue
    if i==int(s[0])*int(s[1]):
      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):
        d1 = d % 10
        d2 = d // 10
        if d1 >= 2 and d2 >= 2:
            if m == d1*d2:
                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(10,D+1):
        a,b = map(int,str(d))
        if a>=2 and b>=2 and a*b == m:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

    cnt=0
    for m in range(1,M+1):
        for d in range(1,D+1):
            if(d//10 < 2 or d%10 <2):
                continue
            if((d%10) * (d//10) == m):
                cnt+=1

    print(cnt)


resolve()

Submission status: Accepted

Solution code:
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    m, d = map(int, readline().rstrip().split())
    if d < 10:
        print(0)
        return

    cnt = 0
    for k in range(1, m + 1):
        for i in range(10, d + 1):
            d1, d10 = int(str(i)[1]), int(str(i)[0])
            if d1 * d10 == k and d1 > 1 and d10 > 1:
                cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
ans = 0
for i in range(1, m + 1):
    for j in range(10, d + 1):  
        d1 = int(str(j)[1])
        d10 = int(str(j)[0])
        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
if d <= 21:
  ans = 0
else:
  for i in range(m):
    i += 1
    for j in range(21, d):
      j += 1
      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:
m,d = map(int,input().split())
cnt = 0
if d <= 19:
    print(0)
    exit()
for i in range(1,m+1):
    for j in range(20,d+1):
        if (j%10)*(j//10) == i and j%10 != 1:
            #print(i,j)
            cnt += 1
print(cnt)

Submission status: Accepted

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

ans = 0
for i in range(1, M+1):
    for j in range(11, D+1):
        j = str(j)
        k = int(j[0])
        l = int(j[1])
        if k >= 2 and l >= 2 and i == k * l:
            ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

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

        if x == y:
            return

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

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

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

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

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

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

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

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

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

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
MD = [int(i) for i in input().split(' ')]
M = [int(i)+1 for i in range(MD[0])]
D = [int(i)+1 for i in range(MD[1])]

count = 0
for d in D:
    if d // 10 >= 2 and d % 10 >= 2:
        d2 = d // 10
        d1 = d % 10
        if d1*d2 in M:
            count+=1

print(count)

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 > 1 and j//10 > 1 and i == (j%10)*(j//10):
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
M, D = [int(_) for _ in input().split()]
ans = 0
for m in range(1, M+1):
  for d in range(1, D+1):
    d0 = d%10
    d10 = (d - d%10)//10
    if d0 > 1 and d10 > 1 and d0 * d10 == m: ans += 1
print(ans)

Submission status: Accepted

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

ans=0
i=1
while i<=M:
    j=22
    while j<=D:
        if j%10>=2 and (j//10)*(j%10)==i:
            ans+=1
        j+=1
    i+=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):
        r = list(str(j))
        if len(r) >= 2:
            if int(r[0])*int(r[1]) == i and int(r[0]) >= 2 and int(r[1]) >= 2:
                ans += 1
                #print(i,j)
print(ans)

Submission status: Accepted

Solution code:
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

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

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Accepted

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

ans=0
for mon in range(1,m+1):
    for day in range(1,d+1):
        if day<22:
            continue
        d1,d2=str(day)
        d1,d2=int(d1),int(d2)
        if d1<2 or d2<2:
            continue
        if d1*d2==mon:
            ans+=1

print(ans)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
if d < 22:
  print(0)
  exit()
cnt = 0
for i in range(1, m + 1):
  for j in range(22, d + 1):
    ten = int(str(j)[0])
    one = int(str(j)[1])
    if ten >= 2 and one >= 2 and ten * one == i:
      cnt += 1
print(cnt)

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):
        x, y = j % 10, j // 10
        if x >= 2 and y >= 2 and x * y == i:
            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(10, D+1):
        d = str(d)
        d10, d1 = map(int, (d[1], d[0]))
        if d10 >= 2 and d1 >= 2 and d10*d1 == m:
            ans += 1
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

print(k)

Submission status: Accepted

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

cnt = 0
for i in range(1,m+1):
    for j in range(10,n+1):
        num = 1
        d = str(j)
        l = len(d)
        
        for k in range(l):
            if int(d[k]) < 2:
                num =1
                break
            else:
                num *=int(d[k])
        if num == i and num !=1:
            cnt +=1
print(cnt)

Submission status: Accepted

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


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

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 or j // 10 < 2:
            continue
        else:
            j_str = str(j)
            mul = int(j_str[0]) * int(j_str[1])
            if mul == 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(10,d+1):
    d1=int(str(j)[0]);d10=int(str(j)[1])
    if len(str(j))==2 and 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(22,d+1):
    if j%10>=2 and (j//10)*(j%10)==i:
      ans=ans+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(2, m+1):
    for j in range(20, d+1):
        dt, do = divmod(j, 10)
        if 1 < do and dt * do == i:
            count += 1

print(count)

Submission status: Accepted

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

print(res)

Submission status: Accepted

Solution code:
# jsc2019_qual_a.py
M,D = map(int,input().split())
cnt = 0
for j in range(1,M+1):
    for i in range(11,D+1):
        a,b = list(str(i))
        a = int(a)
        b = int(b)
        if a*b==j and a>1 and b>1:
            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(22, D+1):
        d10 = d // 10 % 10
        d1 = d % 10
        if d1 >= 2 and d10 >= 2:
            if m == d1 * d10:
                ans += 1

print(ans)

Submission status: Accepted

Solution code:
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:
					#print(i,j)
					c+=1
print(c)

Submission status: Accepted

Solution code:
def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(1, A+1):
        for j in range(10, B+1):
            if str(j)[0] != "1" and str(j)[1] != "1":
                if int(str(j)[0])*int(str(j)[1]) == i:
                    ans += 1
    print(ans)
resolve()

Submission status: Accepted

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

ans = 0

for i in range(1,M+1):
    for j in range(D+1):
        d1,d10 = j%10, j//10
        if d1*d10 == i and d1>= 2 and d10 >= 2:
            ans +=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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 len(str(j)) == 1:
            continue
        d1 = j%10
        d2 = j//10
        if d1 >= 2 and d2 >= 2 and d1*d2==i:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
#from decimal import *

M, D = MAP()
ans = 0
for m in range(1, M+1):
	for d in range(1, D+1):
		if len(str(d)) == 2:
			d1 = int(str(d)[1])
			d10 = int(str(d)[0])
			if 2 <= d1 and 2 <= d10 and d1*d10 == m:
				ans += 1
print(ans)

Submission status: Accepted

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

if D<20:
  print(0)
else :
  count = 0
  for i in range(1,M+1):
    for id in list(range(20, D+1)):
      if int((str(id))[1]) >= 2 and ( int(str(id)[0]))*int((str(id))[1]) == i :
         count += 1
  print(count)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
ans=0
if d<22:
    print(ans)
    exit()
for i in range(1,m+1):
    for j in range(22,d+1):
        if int(str(j)[-1])>=2:
            if i==int(str(j)[0])*int(str(j)[-1]):
                ans+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率

def input(): return sys.stdin.readline()[:-1]
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    #N = int(input())
    M,D = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    count=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):
                count+=1
    print(count)




if __name__ == "__main__":
    main()

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 int(str(j)[1])>=2 and int(str(j)[0])*int(str(j)[1])==i:
            ans+=1
            # print(i,j)
print(ans)

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
M,D = IL()
ans =0
def kake(n):
  if n%10 < 2 or n//10 < 2:
    return 0
  return (n%10)*(n//10)
for i in range(1,M+1):
  for d in range(1,D+1):
    if i==kake(d):
      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, D//10 + 1):
    for k in range(2, 10):
      if j*10 + k > D:
        break
      else:
        if j*k == i:
          ans += 1
print(ans)

Submission status: Accepted

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

jsc19q_a()

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    count = 0

    for i in range(2,a[0]+1):
        for j in range(2,a[1]+1):
            if j > 9:
                k = str(j)
                if i == int(k[0])*int(k[1]) and int(k[0]) > 1 and int(k[1]) >1:
                    count+=1

    print(count)

Submission status: Accepted

Solution code:
# coding: utf-8

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

ans = 0
for i in range(1,m+1):#月
    for j in range(1,d+1):#日
        if len(str(j)) == 2:
            d1 = int(str(j)[0])
            d10 = int(str(j)[1])
            if i >= 2 and d1 >= 2 and d10 >= 2 and int(str(j)[0]) * int(str(j)[1]) == 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):
        x = j//10
        y = j%10 
        if x >= 2 and y >= 2 and x*y==i:
            ans += 1

print(ans)