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:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

m, d = MAP()

# print(d1)
# print(l)
count = 0
for i in range(1, m+1):
    for j in range(1, d+1):
        if j >= 20:
            d1 = j % 10
            d10 = j // 10
            # print(d1)

            if d1 >= 2:
                # print("d1:"d1)
                
                if d1 * d10 == i:
                    count += 1

        # if d1 >= 2:
        #     if d10 >= 2:
        #         if d1 * d10 == m:
        #             count += 1


print(count)

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) :
        d1 = j // 10
        d2 = j % 10
        if d2 < 2 :
            continue

        if d1 * d2 == i :
            ans += 1
            #print(d1, d2, i)

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

print(ans)

Submission status: Accepted

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

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

print(an)

Submission status: Accepted

Solution code:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

M,D = II()

ans = 0

for i in range(M+1):
    for j in range(2,10):
        for k in range(2,10):
            if int(str(j)+str(k))>D:
                continue
            else:
                if i==j*k:
                    ans += 1

print(ans)

Submission status: Accepted

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 < 9:
            d1 += 1
        else:
            d1 = 0
        if d1 == 0:
            d2 += 1
            
print(c)

Submission status: Accepted

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

cnt = 0
for j in range(1, m+1):
    for i in range(22, d+1):
        d1 = i % 10
        d10 = i // 10

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

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 24 21:02:49 2019

@author: kato yugo
"""

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

ans = 0

if d >= 22:
    for i in range(m):
        month = i+1
        for j in range(d):
            day = j+1
            day10 = int(day/10)
            day1 = day%10
            
            if day1 >= 2 and day10 >=2:
                if day10*day1 == month:
                    ans += 1
                    
                    
print(ans)

Submission status: Accepted

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

for i in range(1,d+1):
    if (i%10)*((i-i%10)/10) <= m and (i%10)*((i-i%10)/10) != 0 and i%10 >= 2 and i-i%10 >= 20:
        k += 1
        
print(k)

Submission status: Accepted

Solution code:
def possible(m,d):
    d = str(d)
    if len(d) < 2:
        return False
    if int(d[0]) >= 2 and int(d[1]) >= 2 and int(d[0])*int(d[1]) == m:
        return True
    return False

def main():
    m,d = map(int,input().split())
    ans = 0
    for month in range(1,m+1):
        for day in range(1,d+1):
            if possible(month,day):
                ans += 1

    print(ans)


main()

Submission status: Accepted

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+1):
        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: Accepted

Solution code:
m,d = map(int,input().split())
cnt = 0
for i in range(22,d+1):
	if i%10<=1:
		pass
	else:
		s = str(i)
		if  int(s[0])*int(s[1]) <= m:
			cnt += 1
print(cnt)

Submission status: Accepted

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

ans = 0

if D <= 21:
    ans = 0
else:
    for d_ in range(22,D+1):
        d = list(map(int, str(d_)))
        if int(d[0])<2 or int(d[1])<2:
            continue
        for m in range(1,M+1):
            if d[0] * d[1] == m:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
m,n=map(int,input().split())
count=0
for a in range(m):
  for day in range(n):
    b=(day+1)//10
    c=(day+1)%10
    #print(b,c)
    if a+1==b*c and b>=2 and c>=2:
      count+=1
print(count)

Submission status: Accepted

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

if M < 2:
    print(0)
elif D < 12:
    print(0)
else:
    mulday = 0
    for m in range(2,M+1):
        for d in range(12,D+1):
            d10 = int(str(d)[0])
            d1 = int(str(d)[1])
            if d10 == 1 or d1 == 1:
                continue
            if d10*d1 == m:
                #print(m,d)
                mulday+=1
                
    print(mulday)

Submission status: Accepted

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

cnt = 0
for i in range(20, D+1):
  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: Accepted

Solution code:
m, d = map(int, input().split())
cnt = 0
for i in range(4, m+1):
  for j in range(10, d+1):
    d10, d1 = j//10, j%10
    if d1 < 2 or d10 < 2:
      continue
    if i == d10 * d1:
      #print(i, '月', d10*10+d1, '日')
      cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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):
            tmp = int(str(j) + str(k))
            if D < tmp:
                break
            if i == j * k:
                ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

ans = 0
for i in range(1, m+1):
    days = []
    for j in range(1, int(math.sqrt(i))+1):
        if j==1:
            continue
        if i%j==0:
            days.append(str(j)+str(i//j))
            if i//j != j:
                days.append(str(i//j)+str(j))

    for x in days:
        if int(x)<=d:
            ans += 1

print(ans)

Submission status: Accepted

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

days = 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 and d1*d2 == m:
            days += 1

print(days)

Submission status: Accepted

Solution code:
M, D = list(map(int, input().split()))
count = 0
for month in range(1,M+1):
    for day in range(1,D+1):
        d10,d1 = divmod(day, 10)
        if (d10 >= 2) & (d1 >= 2) & (d10 * d1 == month):
            count = count + 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans=0

if D>=22 and M>=4:
    for m in range(M+1)[4:]:
        for d in range(D+1)[22:]:
            if d//10>1 and d%10>1 and (d//10)*(d%10)==m:
                ans+=1

print(str(ans))

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
if d<22:
    print(0)
    exit()
if m<4:
    print(0)
    exit()

ans=0
for i in range(1,m+1):
    for j in range(1,d+1):
        a=j//10
        b=j%10
        if a<2 or b<2:
            continue
        if a*b==i:
            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 i in range(1,D+1):
        d = str(i).zfill(2)
        if int(d[0])<2 or int(d[1])<2:
            continue
        n = int(d[0])*int(d[1])
        if n == m:
            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):
        d_list = divmod(d, 10)
        if d_list[0] >= 2 and d_list[1] >= 2 and d_list[0] * d_list[1] == m:
            ans += 1
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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 j%10<=1:continue
      if i==int(str(j)[0])*int(str(j)[1]):
        cnt+=1
  print(cnt)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
ans = 0
for i in range(1, m+1):
    days = filter(lambda x: '2' <= x[1], [str(x) for x in range(22, d+1)])
    for day in days:
        if int(day[0]) * int(day[1]) == i:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
count = 0
for i in range(22, D+1):
    str_i = str(i)
    if int(str_i[0]) < 2 or int(str_i[1]) < 2:
        continue
    if int(str_i[0]) * int(str_i[1]) <= M:
        count += 1
print(count)

Submission status: Accepted

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

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


print(ans)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
if D < 22:
  print(0)
  exit()
ans = 0
for i in range(22,D+1):
  d1 = i % 10
  d10 = i // 10
  if d1 >= 2 and d10 >= 2 and M >= d1 * d10:
    ans += 1
    #print(M,d1,d10)
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(22, d + 1):
        d1 = d % 10
        d10 = d // 10
        if d1 < 2:
            continue
        if m == d1 * d10:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
M,D=map(int,input().split())
d1=int(D/10)
d2=D-d1*10
cnt=0

for i in range(M+1):
	for j in range(D+1):
		d1=int(j/10)
		d2=j-d1*10
		if d1*d2==i and d1>1 and d2>1:
			cnt+=1
			
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M,D=(int(x) for x in input().split())
if D<=21:
    print(0)
else:
    c=0
    for n in range(22,D+1):
        d1=n%10
        d2=n//10
        if d1>=2:
            if d2>=2:
                if d1*d2<=M:
                    c=c+1
    print(c)

Submission status: Accepted

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

ans = 0

if d > 9:
    for i in range(d - 9):
        s = str(i + 10)
        if int(s[-1]) > 1 and int(s[-2]) > 1:
            t = int(s[-1]) * int(s[-2])
            if t <= m and t != 0:
                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 == 1 or j%10 == 1:
      continue
    a = (j//10) * (j%10)
    if i == a:
      ans += 1
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A問題
M,D = map(int,input().split())
count = 0
for j in range(D):
    J = j+1
    s=list(str(J))
    if len(s) >= 2:
        if int(s[0]) >= 2 and int(s[1]) >= 2:
            m = int(s[0])*int(s[1])
            if m <= M:
                count+=1
                
print(count)

Submission status: Accepted

Solution code:
from collections import defaultdict


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

prod_set = defaultdict(lambda: 0)
for d in range(1, D + 1):
    if d >= 10:
        d1 = d % 10
        d10 = int((d - d1) / 10)
        if d1 >= 2 and d10 >= 2:
            m = d1 * d10
            prod_set[m] += 1

res = 0
for m in range(1, M + 1):
    if m in prod_set:
        res += prod_set[m]
print(res)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
count = 0
for i in range(m):
    for j in range(d):
        day = j + 1
        if day <= 21:
            continue
        lst = []
        while day > 0:
            lst.append(day%10)
            day //= 10
        lst.reverse()
        if (lst[0] < 2) or (lst[1] < 2):
            continue
        if lst[0] * lst[1] == i + 1:
            count += 1
print(count)

Submission status: Accepted

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>=2 and t>=2:
				if s*t==i:cnt+=1
	print(cnt)

Submission status: Accepted

Solution code:
import sys
def main():
    input = sys.stdin.readline
    MD = list(map(int, input().split()))
    M = MD[0]
    D = MD[1]

    if D < 22:
        ans = 0
    else:
        ans = 0
        for m in range(M):
            m += 1
            for d in range(D):
                d += 1
                if d >= 22:
                    d_1 = int(str(d)[1])
                    if d_1 >= 2:
                        d_10 = int(str(d)[0])
                        if d_1 * d_10 == m:
                            ans += 1
                            #print(d_1)
                            #print(d_10)
                            #print(m,d)
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

if d<22:
    print("0")
    sys.exit(0)

cnt = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        j_10=int(j/10)
        j_1=j-j_10*10
        #print(i,j,j_10,j_1)
        if (j_1>=2) and (j_10>=2) and (j_1*j_10==i):
            cnt += 1
            
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
count=0
 
if d<20:
  print(count)
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: Accepted

Solution code:
m,d = [int(x) for x in input().split()]
print(len([i for i in range(21,d+1) if (i%10) >= 2 and 4 <= (i//10)*(i%10) <= m ]))

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

M, D =  map(int, sys.stdin.readline().split())

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

cnt = 0

for m in range(1, M + 1):
    for i in range(10, D + 1):
        Ds = str(i)
        D10 = int(Ds[0])
        D1 = int(Ds[1])
        if m == D10 * D1:
            if D1 >= 2 and D10 >= 2:
                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(2,d+1):
        if((j//10) * (j%10) == i and j//10 != 1 and j%10 != 1):
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
f = lambda m, d: d > 19 and d % 10 > 1 and m == (d // 10) * (d % 10)
M, D = map(int, input().split())
print(sum(f(m, d) for m in range(1, M + 1) for d in range(12, D + 1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
ans=0
for i in range(n):
  for j in range(m):
    mo=i+1
    da=j+1
    if(da>=11):
      dd=str(da)
      if(mo==int(dd[0])*int(dd[1])):
        if(int(dd[0])>=2 and int(dd[1])>=2):
          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):
    d10 = d // 10
    d1 = d - d10 * 10
    if d10 >= 2 and d1 >= 2:
      if d1 * d10 == m:
        cnt += 1
print(cnt)

Submission status: Accepted

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

if d < 22:
    print('0')
else:
    for i in range(22, d+1):
        s = str(i)
        if int(s[0]) < 2 or int(s[1]) < 2:
            continue
        k = int(s[0]) * int(s[1])
        if k >= 2 and k <= m:
            #print(i)
            ans += 1
    print(ans)

Submission status: Accepted

Solution code:
n, m = map(int,input().split())
cnt = 0
for i in range(1,n+1):
  for j in range(1,m+1):
    if j>=22:
      str_j = str(j)
      d1 = str_j[0]
      d10 = str_j[1]
      if int(d1)*int(d10)==i and d1!='1' and d10 != '1':
        cnt+=1
print(cnt)

Submission status: Accepted

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)))
            elif int(str(ma)+str(mi)) <= D:
                cand.add(int(str(m)+str(ma)+str(mi)))

        i += 1
print(len(cand))

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

Submission status: Accepted

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


def main():
    m, d = map(int, input().split())
    ans = 0

    for mi in range(1, m + 1):
        for di in range(1, d + 1):
            d10 = di // 10
            d1 = di - d10 * 10

            if mi == d1 * d10 and d1 >= 2 and d10 >= 2:
                ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for mul in range(1, M + 1):
    for date in range(11, D + 1):
        if (date // 10) == 1 or (date % 10) in [0, 1]:
            continue
        temp = (date//10)*(date % 10)

        if temp == mul:
            ans += 1
            # print((mul, date))
print(ans)

Submission status: Accepted

Solution code:
"""
N = int(input())
A, B = map(int,input().split())
lst = [list(map(int,input().split())) for i in range(M)]
A = list(map(int,input().split()))
"""

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

if D < 10 or M < 4:
  print(0)
  exit()
  
ans = 0
for day in range(10,D+1):
  d1 = day % 10
  d10 = day // 10
  if d1 > 1 and d10 > 1:
    if d1 * d10 <= M:
      ans += 1
      
print(ans)

Submission status: Accepted

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

counter = 0
index = 1
while index <= m:
    index2 = 10
    while index2 <= d:
        dL = list(str(index2))
        d1 = int(dL[0])
        d10 = int(dL[1])
        if d1 >= 2 and d10>=2 and d1*d10 == index:
            counter+=1
        index2+=1
    index+=1
print(counter)

Submission status: Accepted

Solution code:
import sys

parts = sys.stdin.readline().split(' ')
m = int(parts[0])
n = int(parts[1])
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#A
import sys
#sys.setrecursionlimit(100000)

tmp = input().split()
m,d = list(map(lambda a: int(a), tmp))

#print("m:{} d:{}".format(m,d))

ans=0
for i in range(1,m+1):
#	print("i:{}".format(i))
	for j in range(1,d+1):
		d10=j//10
		d1=j%10
		if((d1>=2)and(d10>=2)and(d1*d10==i)):
			ans+=1
#			print(d10)
#			print(d1)

print(ans)

Submission status: Accepted

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

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

    print(count)



resolve()

Submission status: Accepted

Solution code:
from itertools import product

M, D = map(int, input().split())
m_day = [(m, d) for m, d in product(range(1, M+1), range(22, D+1)) if int(str(d)[0]) >= 2 and int(str(d)[1]) >= 2 and m == int(str(d)[0]) * int(str(d)[1])]
print(len(m_day))

Submission status: Accepted

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

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

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 - d1)//10
    if d1 > 1 and d2 > 1 and m == d1 * d2:
      ans +=1
    #print(d1,d2,m)
print(ans)

Submission status: Accepted

Solution code:
M,D = [int(i) for i in input().split(" ")]
s = 0
for m in range(1,M+1):
    for d in range(20,(D+1)):
        d1 = d % 10
        d2 = d//10
        if d1 * d2 == m and d1 >= 2 and d2 >= 2:
            s+=1
print(s)

Submission status: Accepted

Solution code:
def solve():
  M, D = map(int, input().split())
  ans = 0
  D1 = D // 10
  D10 = D % 10

  for m in range(1, M + 1):
    for d1 in range(2, D1 + 1):
      if m % d1 != 0: continue
      d10 = m // d1
      if 1 < d10 and d10 < 10 and (d1 != D1 or d10 <= D10): ans += 1

  return ans

print(solve())

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):
        if d % 10 >= 2 and d // 10 >= 2 and (d % 10) * (d // 10) == m:
            cnt += 1
print(cnt)

Submission status: Accepted

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

def search(m,D):
    box = []
    for j in range(2,10):
        if m%j == 0 and 9 >= m/j >= 2:
            a = j*10+int(m/j)
            if a <= D:
                box.append(j*10+int(m/j))
    return box

c = 0
for m in range(1,M+1):
    box = search(m,D)
    c += len(box)

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in range(m+1):
    for j in range(d+1):
        if j //10 >= 1:
            a = j // 10
            b = j % 10
            if i == a * b and a != 1 and i != 0and b != 1:
              ans += 1
                
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/08/24
# 第一回日本最強プログラマー学生選手権-予選- - A

# Input
m, d = map(int,input().split())
cnt = 0

# Calc
for i in range(2, m+1):
    for j in range(2, d+1):
        d1 = int(j / 10)
        d10 = j % 10
        if d1 > 1 and d10 != 1:
            if d1 * d10 == i:  
                cnt = cnt + 1

# Output
print(cnt)

Submission status: Accepted

Solution code:
m, d = [int(elem) for elem in input().split()]

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    M,D = map(int, input().split())
    days = set()
    for d in range(D+1):
        d_1 = d % 10
        d_10 = d // 10
        if d_1 < 2 or d_10 < 2:
            continue
        m = d_1*d_10
        day = (m,d)
        if (day not in days) and (m <= M):
            days.add(day)
    print(len(days))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for m in range(M+1):
    for d in range(D+1):
        if (d%10)*(d//10)==m and d%10>=2 and d//10>=2:
            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
        d10 = d // 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == m:
            ans += 1
print(ans)