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:
M, D=map(int, input().split())

counter=0

m=1
while m<=M:
  d=22
  while d<=D:
    d1=d%10
    d10=d//10
    if d1>1 and d10>1 and d1*d10==m:
      counter+=1
    
    d+=1
  
  m+=1
  
print(counter)

Submission status: Accepted

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

if int(d) < 22 or int(m) < 4:
    print(ans)
    exit()

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

print(ans)

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split(" ")]
num = 0
for m in range(1, a[0]+1):
    for d in range(10, a[1]+1):
        d_1 = list(str(d))
        if int(d_1[0]) >= 2 and int(d_1[1]) >= 2 and int(d_1[0])*int(d_1[1]) == m:
            num += 1
print(num)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
M, D = map(int, input().split())

ans_count = 0
if D >= 22:
    for i in range(22, D + 1):
        first_place = i % 10
        tenth_place = i // 10
        if first_place > 1 and tenth_place > 1 and first_place * tenth_place <= M:
            ans_count += 1

print(ans_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = input().split()
m = int(l[0])
d = str(l[1])
cnt = 0 
for i in range(1, m+1):
  for j in range(22, int(d)+1):
    j = str(j)
    d10 = int(j[0])
    d1 = int(j[1])
    if i == d10 * d1 and d10 >= 2 and d1 >= 2:
      cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
from sys import stdin

m,d = map(int,stdin.readline().rstrip().split())
day = 0
for s in range(1,m+1):
    for i in range(1,d+1):
        if i > 9:
            k = str(i)
            ten = int(k[0])
            one = int(k[1])
            if ten>1 and one>1:
                if ten*one == s:
                    day += 1
print(day)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

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):
        listD = [int(c) for c in str(j)]
        if listD[0] * listD[1] == i and listD[1] >= 2:
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

m, d = na()
if d < 22:
    print(0)
else:
    d10max = int(str(d)[0])
    d1max = int(str(d)[1])
    c = 0
    for d10 in range(2, d10max):
        for i in range(2, 10):
            if d10 * i <= m:
                c += 1

    for i in range(2, d1max+ 1):
        if d10max * i <= m:
            c += 1
    print(c)

Submission status: Accepted

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

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

    if d1 >= 2 and d2 >= 2 and d1 * d2 <= M:
        count += 1
print(count)

Submission status: Accepted

Solution code:
MD = [int(i) for i in input().split()]

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

        if m == d1 * d10:
            #print("d-> %d,m -> %d, d1 - > %d, d10 -> %d"%(d, m,d1,d10))
            c+=1

print(c  )

Submission status: Accepted

Solution code:
M,D = map(int, input().split())
c = 0
if 10 <= D:
  for i in range(2,M+1):
    for j in range(10,D+1):
      J = list(map(int, str(j)))
      if i == J[0] * J[1] and J[0] >= 2 and J[1] >= 2:
        c += 1
  print(c)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

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

if M < 4:
    print('0')
else:
    for i in range(4, M+1):
        for j in range(22, D+1):
            j = str(j)
            jli = list(j)
            if jli[1] == '0' or jli[1] == '1':
                pass
            else:
                if int(jli[0])*int(jli[1]) == i:
                    # print(i, jli)
                    cnt += 1

    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
inputs = sys.stdin.readlines()

M, D = map(int, inputs[0].split())

good_dates = []
for date in range(D):
    d10 = (date+1) // 10
    d1 = (date+1) % 10
    if d1 >= 2 and d10 >= 2:
        if d1*d10 <= M:
            good_dates.append((d1*d10, date))
print(len(good_dates))

Submission status: Accepted

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

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

print(ct)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

m, d = map(int, input().split())
day = [i for i in range(22, d+1)]

res_mult = []
for d in day:
    d10 = int(list(str(d))[0])
    d1 = int(list(str(d))[1])
    if d1 < 2:
#        print("pass")
        continue
    else:
        res_mult.append(d10*d1)

#print(res_mult)
res_mult = np.array(res_mult)

#print(res_mult)
print(np.sum(res_mult <= m))

Submission status: Accepted

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

count = 0
for m in range(4,M+1):
    day = list(range(22,D+1))
    for d in day:
        D1,D10 =map(int,list(str(d)))
        if D1<=1 or D10 <=1:
            continue
        
        if m==D1*D10:
            count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
count = 0
for i_m in range(m + 1):
    for j_d in range(d + 1):
        d_01 = j_d % 10
        d_10 = j_d // 10
        if d_01 < 2 or d_10 < 2:
            continue
        if i_m == d_01 * d_10:
            count += 1
print(count)

Submission status: Accepted

Solution code:
M, D = [int(x) for x in input().split()]
dates = list(range(22,D+1))
c = 0
 
for i in range(len(dates)):
  d1 = int(str(dates[i])[-1])
  d2 = int(str(dates[i])[-2])
  if d1*d2 <= M and d1 > 1 and d2 > 1:
    #print(d2,d1)
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
c = 0
for i in range(m):
    for j in range(max(0, d - 9)):
        dl = list(map(int, list(str(j + 10))))
        if dl[0] >= 2 and dl[1] >= 2 and dl[0] * dl[1] == i + 1:
            c += 1
print(c)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
count = 0
if D < 22:
  print(count)
  exit()

for i in range(1,M+1):
  for j in range(22,D+1):
    if i == (j//10) * (j%10):
      if j%10 <= 1:
        continue
      else:
        count += 1
print(count)

Submission status: Accepted

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

ans=0
for j in range(1,m+1):
  for i in range(11,d+1):
    l=[int(a) for a in str(i)]
    if 1 not in l:
      x=l[0]*l[1]
      if j==x:
        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(22, D+1):
        d10 = int(str(d)[1])
        d1 = int(str(d)[0])
        if m == d10 * d1 and d10>=2 and d1 >= 2:
            ans += 1
#             print(m, d)
print(ans)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
d10 = d // 10
d1 = d - d10
ans = 0
for i in range(1,m+1):
    for j in range(1, d + 1):
        j = str(j).zfill(4)
        j1 = int(j[-1])
        j10 = int(j[-2])
        if j1 >= 2 and j10 >= 2 and j1 * j10 == i:
            ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for j in range(i[0]):
    for k in range(i[1]):
        k += 1
        if len(str(k)) >= 2:
            k = str(k)
            if (int(k[-1])>=2)and(int(k[-2])>=2):
                if j+1 == int(k[-1])*int(k[-2]):
                    #print(j+1,int(k[-1]),int(k[-2]))
                    ans += 1
            k = int(k)
        k -= 1

        
print(ans)

Submission status: Accepted

Solution code:
M, D = map(int,input().split())
count = 0
for i in range(22, D+1):
    l = [int(x) for x in list(str(i))]
    if l[1] == 0 or l[1] == 1:
        pass
    elif l[0] * l[1] <= M:
        count += 1

print(count)

Submission status: Accepted

Solution code:
M, D = map(str, input().split())
output = 0

for i in range(1, int(M) + 1):
    for k in range(20, int(D) + 1):
        if i == (k // 10) * (k % 10)  and k % 10 >= 2:
            output += 1

print(output)

Submission status: Accepted

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

ans = 0

for _m in range(m):
  _m += 1
  for _d in range(d):
    _d += 1
    if _d >= 22:
      d1 = int(str(_d)[0])
      d2 = int(str(_d)[1])
      if d2 < 2:
        continue
      if _m == d1 * d2:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    M, D = map(int, input().split())
    #D10 = int(D[0])
    #D1 = int(D[1])

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

    print(count)

Submission status: Accepted

Solution code:
M, D = map(int, input().split(" "))
counter = 0
for i in range(1, M+1):
    for j in range(11, D+1):
        if int(str(j)[0])>=2 and int(str(j)[1])>=2:
            if i == int(str(j)[0]) * int(str(j)[1]):
                counter += 1
            else:
                counter += 0
print(counter)

Submission status: Accepted

Solution code:
m,d = map(int, input().split(' '))
mlist = list(range(m+1))
c = 0
for _d in range(d+1):
	d1 = _d // 10
	d0 = _d % 10
	if d1 > 1 and d0 > 1 and d1*d0 in mlist:
		c+=1
print(c)

Submission status: Accepted

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

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

print(num_d)

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):
        d1,d2=map(int,str(j))
        if i==(d1*d2) and d2>=2:
            count+=1
            
print(count)

Submission status: Accepted

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

import sys
input = sys.stdin.readline

M,D = map(int, input().split())
ans = 0
for i in range(1, M+1):
    for j in range(22, D+1):
        a = int(str(j)[0])
        b = int(str(j)[1])
        if a >= 2 and b >= 2:
            if a * b == i:
                ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

cnt = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        a = d//10
        b = d - a*10
        if a>=2 and b>=2 and a*b == m:
            cnt += 1

print(cnt)

Submission status: Accepted

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

cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int, input().split())

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
day_li = [i for i in range(1, d + 1)]
month_li = [j for j in range(1, m + 1)]

ans = 0
for k in day_li:
    if k >= 10:
        if int(str(k)[0]) * int(str(k)[1]) in month_li and int(str(k)[0]) >= 2 and int(str(k)[1]) >= 2:
            ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
import sys
from functools import lru_cache

def main():
    (m,d) = map(int, input().split(' '))
    ret = 0
    mlist = [i+1 for i in range(m)]
    for i in range(22,d+1):
        d10,d1 = divmod(i,10)
        if d10 == 1 or d1 == 1:
            continue
        if d10*d1 in mlist:
            ret += 1


    
    print(ret)
        





if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
count = 0
if d>21:
	for i in range(d-21):
		b = int((i+22)/10)
		a = (i+22)-(b*10)
		if a>1 and b>1:
			if m >= (a*b):
				count += 1
	print(count)
else:
	print(0)

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0
if d >=22:
    for i in range(22,d+1):        
        if int(str(i)[1])==1 or int(str(i)[1])==0:
            continue
        else:
            for j in range(1,m+1):
                if int(str(i)[1])*int(str(i)[0])==j:
                    
                    cnt+=1
    print(cnt)
else:
    print("0")

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

M, D = map(int,input().split())
c_list = []
m_list = []

if D>=22:
    for k in range(22,D+1):
        k_str = str(k)
        d10 = int(k_str[0])
        d1  = int(k_str[1])
        m = d10*d1
        if d1>=2:
            m_list.append(m)

else:
    print(0)
    sys.exit()

for i in range(M+1):
    c = m_list.count(i)
    c_list.append(c)

print(sum(c_list))

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
def takahashi_cal(m: int, d: int) -> int:
    res = 0
    for mm in range(1, m + 1):
        for dd in range(1, d + 1):
            d1 = dd % 10
            d10 = dd // 10
            if any([d1 < 2, d10 < 2]):
                continue
            if d1 * d10 == mm:
                res += 1
    return res
    
m, d = input().split(" ")
print(takahashi_cal(int(m), int(d)))

Submission status: Accepted

Solution code:
m, d= (int(i) for i in input().split())
ans = 0
for month in range(m):
  month = month+1
  for day in range(d):
      day += 1
      if(day > 9):
          d10 = day // 10
          d1 = day % 10
          if(d10 * d1 == month and d1 > 1 and d10 > 1):
              ans += 1
              #print(str(month)+"/"+str(day))
print(ans)

Submission status: Accepted

Solution code:
M,D = (int(a) for a in input().split())
count = 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:
            count += 1
print(count)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
answer = [0 for day in filter(lambda x: x // 10 > 1 and x % 10 > 1, range(1, d + 1)) if 1 <= ((day // 10) * (day % 10)) <= m]
print(len(answer))

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:
            d_1 = str(d)[-1]
            d_10 = str(d)[-2]
            if int(d_1) * int(d_10) == m and int(d_1) >= 2 and int(d_10) >= 2:
                ans += 1
        else:
            continue

print(ans)

Submission status: Accepted

Solution code:
def hantei(m, d):
    d1 = d//10
    d2 = d % 10

    if d1 > 1 and d2 >1:
        if d1*d2 == m:
            return 1
        else:
            return 0
    else:
        return 0



M, D = map(int, input().split(' '))
cnt = 0
if D > 20:
    for m in range(1, M + 1):
        for d in range(21, D + 1):
            if hantei(m, d) == 1:
                cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
cnt = 0
for i in range(22,d+1):
    d1=int(str(i)[0])
    d2=int(str(i)[1])
    if d2>1:
        if d1*d2 <= m:
          cnt += 1
print(cnt)

Submission status: Accepted

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

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

    x = sum(max(1, min(9, M//a))-1 for a in range(2, D//10))

    if D >= 10:
        x += max(1, min(min(9, D%10), M//(D//10) )) - 1
        
    
    print(x)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# A - Takahashi Calendar
M, D = map(int,input().split())
count = 0
for k in range(4, M+1):
    for i in range(22, D+1):
        if i // 10 >= 2 and i % 10 >= 2:
            if k == (i//10)*(i % 10):
                count = count + 1
            else:
                pass
        else:
            pass
print(count)

Submission status: Accepted

Solution code:
from functools import reduce
M, D = map(int, input().split())
#[(4, '22'), ('6', '23'), ('6', '32'), ('8', '24'), ('9', '33'), ('10', '25'), ('12', '26'), ('12', '34'), ('14', '27'), ('15', '35')]

count = 0
for m in range(1, M+1):
    for d in range(12, D+1):
        if '1' in str(d):
            continue
        elif reduce(lambda x, y: x*y, map(int, list(str(d)))) == m:
            count += 1
print(count)

Submission status: Accepted

Solution code:
def check(m,d1,d10):
    if d1 < "2" or d10 < "2":
        return False
    if int(d1)*int(d10) == m:
        return True
    return False

M,D = map(int,input().split())
count = 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 check(m,d[1],d[0]):
            count += 1
print(count)

Submission status: Accepted

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

D = int(D)
ans = 0

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


print(ans)

Submission status: Accepted

Solution code:
m, d2 = map(int, input().split())
count = 0
for m in range(1,m+1):
    for d in range(1,d2+1):
        d = str(d)
        if len(d) < 2:
            continue
        d1 = int(d[1])
        d10 = int(d[0])
        if d10 >= 2 and d1 >= 2 and d10 * d1 == m:
            count += 1
print(count)

Submission status: Accepted

Solution code:
#coding: utf-8
m,d = map(int, input().split())
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
a=[]
for x in input().split(" "):
    a.append(int(x))
b=a[0]
c=a[1]
d=[]
i=0
c=str(a[1])
for x in c:
    d.append(int(x))
m=1
da=1
dal=[]
while m<=a[0]:
    while da<=a[1]:
        for x in str(da):
            if len(str(da))==1:
                dal=[0,int(x)]
            else:
                dal.append(int(x))
        if dal[0]*dal[1]==m and dal[0]>=2 and dal[1]>=2:
            i+=1
        da+=1
        dal=[]
    m+=1
    da=0
print(i)

Submission status: Accepted

Solution code:
import sys

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

if M < 4 or D < 22:
  print('0')
  sys.exit()

  
for i in range(4,M + 1):
  for j in range(22, D + 1):
    str_j = str(j)
    d_t = int(str_j[-2])
    d_o = int(str_j[-1])
    if d_o < 2:
      continue
    if i == d_t * d_o:
      Ans = Ans + 1

print(Ans)

Submission status: Accepted

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

Submission status: Accepted

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

cnt=0

for i in range(4,m+1):
    for j in range(2,i+1):
        if i%j==0 and i%(i//j)==0 and i>1 and i//j>1:
            tmp=int(str(j)+str(i//j))
            if tmp<=d:
                cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
for i in range(22, d+1):
	d10 = i // 10
	d1 = i % 10
	if d1 < 2:
		continue
	if d1 * d10 <= m and d1 * d10 != 0:
		result += 1

print(result)

Submission status: Accepted

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

count = 0

d = [ m for m in range(22, D+1) if int(str(m)[1])>=2 ]

m = list(range(1, M+1))

for x in d:
    if int(str(x)[0])*int(str(x)[1]) in m:
        count += 1

print(count)

Submission status: Accepted

Solution code:


def solve():
    M, D = map(int, input().split())
    count = 0
    for d in range(1, D + 1):
        d1 = d % 10
        d10 = int(d / 10)
        if d1 >= 2 and d10 >= 2 and 0 < d1 * d10 <= M:
            count += 1
    print(count)


if __name__ == '__main__':
    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(21, D + 1):
        a = d // 10
        b = d % 10
        if b < 2:
            continue

        if a * b == m:
            cnt += 1

print(cnt)

Submission status: Accepted

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

for month in range(1, m+1):
	for day in range(1, d+1):
		if len(str(day)) >= 2:
			if int(str(day)[0]) >= 2 and int(str(day)[1]) >= 2 and int(str(day)[0]) * int(str(day)[1]) == month:
				ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

sekiday=0
for i in range(2,M+1):
  for j in range(2,D+1):
    d1=j%10
    d2=j//10
    if i==d1*d2 and min(d1,d2)!=1:
#      print (i,j,d1,d2)
      sekiday+=1

print(sekiday)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
num_month, day_per_month = map(int, input().split(' '))

ans = 0
for month in range(4, num_month+1):
    ans += len([day for day in range(22, day_per_month+1)
                if day // 10 >= 2 and day % 10 >= 2 and (day // 10) * (day % 10) == month])

print(ans)
exit(0)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    M, D = [int(x) for x in stdin.readline().rstrip().split()]

    sum = 0

    for d in range(11, D+1):
        d_10, d_1 = str(d)

        if int(d_10) > 1 and int(d_1) > 1:
            if M >= int(d_10) * int(d_1):
                sum += 1

    print(sum)


if __name__ == "__main__":
    main()

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):
        if str(j)[0] != "1" and str(j)[1] != "1":
            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())
count=0
for i in range(m+1):
  for k in range(d+1):
    if k < 21 :
      pass
    elif int(str(k)[1]) < 2:
      pass
    else:
      if int(str(k)[0])*int(str(k)[1]) == i:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import numpy as np

I=np.array(input().split(),dtype=np.int32)

M=I[0]
D=I[1]

count=0

def check(d,m):
    d10=int(d[0])
    d1=int(d[1])
    if(d10>=2 and d1>=2 and m==d10*d1):
        return True
    return False

for m in range(1,M+1):
    for d in range(22,D+1):
        if(check(str(d),m)):
            count+=1

print(count)

Submission status: Accepted

Solution code:
List = list(map(int,input().split()))
M = List[0]
D = List[1]
count = 0
for a in range(1,M+1):
	for b in range(1,D+1):

		d_10 = int(b/10)
		d_1 = int(b - 10 * d_10)

		if d_1 >= 2 and d_10 >= 2 and d_1 * d_10 == a:
			count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


SUM = 0
for m in range(4, int(M)+1) :
    for d in range(22, int(D)+1) :
        if ( int(d % 10) ) * ( int(d / 10) ) == m \
            and int(d % 10) != 1 and int(d / 10) != 1:
            SUM+=1
        
print(SUM)