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())

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a,b=map(int, input().split()) 
count=0
for i in range(2,a+1):
  for j in range(2,b+1):
    daylist = list(str(j))
    day1 = int(daylist[0])
    if len(daylist) != 1 :
      day2 = int(daylist[1])
      #print(day1 * day2)
      if i == day1 * day2:
        if day1 !=1:
          if day2 !=1:
            #print(str(i)+str(" ")+str(day1)+str(" ")+str(day2))
            count += 1
print(count)

Submission status: Accepted

Solution code:
import sys

def process(data):
	count = 0

	M = int(data[0])
	D = data[1]
	
	if len(D) < 2:
		return 0


	for d10 in range(2, int(D[0])+1):
		for d1 in range(2, 10):
			if 0 < d10 * d1 and d10 * d1 <= M:
				if int(str(d10)+str(d1)) <= int(D):
					count += 1
				else:
					break


	return count 

def main(argv):
	for i in range(1):
		data = raw_input()
		data = data.split(" ")
	print(process(data))

	

if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

cnt = 0
for m in range(1, mm + 1):
	for d in range(1, dd + 1):
		d1 = d % 10
		d2 = d// 10
		if d1 >= 2 and d2 >= 2 and d1 * d2 == m:
			cnt += 1
print(cnt)

Submission status: Accepted

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

def ok(a,b,d10,d1):
	if d10>a:
		if 10>b:
			re=1
		else:
			re=0
	if d10==a:
		if d1>=b:
			re=1
		else:
			re=0
	if d10<a:
		re=0
	return re



m,d=map(int,input().split())
count=0
if d<10:
	print(0)
	exit()
d10=int(str(d)[0])
d1=int(str(d)[1])
for i in range(1,m+1):
	# print(yakusu)
	yakusu=make_divisors(i)
	yakusu.sort()
	

	yakusu=yakusu[1:-1]
	# print(yakusu)
	# print(d10,d1)
	if len(yakusu)%2==1:
		a =yakusu[len(yakusu)//2]
		if ok(a,a,d10,d1):
			count+=1
		del yakusu[len(yakusu)//2]
	for j in range(0,len(yakusu)//2):
		if ok(yakusu[j],yakusu[-j-1],d10,d1):count+=1
		if ok(yakusu[-j-1],yakusu[j],d10,d1):count+=1
	# print(count)
print(count)
# print(ok(4,2,4,0))

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
count = 0
for i in range(1,M+1):
    for j in range(1,D+1):
        if len(str(j)) == 1 or int(str(j)[0]) <= 1 or int(str(j)[1]) <= 1:
            continue
        if int(str(j)[1])*int(str(j)[0]) == i:
            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):
        d_10 = j//10
        d_1 = j % 10
        if d_1 >= 2 and d_10 >= 2 and d_1 * d_10 == i:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
def OK(d1,d10,m):
    if d1>=2 and d10>=2 and d1*d10==m:
        return True
    else:
        return False
in1=input()
M1,D1=in1.split()
M=int(M1)
D=int(D1)
con=0
for m in range(M+1):
    for d in range(D+1):
        ones=d%10
        if D>=10:
            tens=d//10
        else:
            tens=0
        if OK(ones,tens,m):
            con+=1
print(con)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(1000000)


def getN():
    return int(input())


def getList():
    return list(map(int, input().split()))


import math

ans = 0
m, d = getList()

for i in range(1, m+1):
    for j in range(1, d+1):
        if j <= 21:
            pass
        else:
            if (j % 10) * (j // 10) == i:
                if (j % 10) >= 2:
                    # print(i, j)
                    ans += 1

print(ans)

Submission status: Accepted

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

# スペース区切りの整数の入力
m, d = map(int, input().split())
ans =0

for month in range(1, m+1):
    for i in range(22, d+1):
        d_list = list(str(i))
        d1   = int(d_list[1])
        d10 = int(d_list[0])
        if d1 < 2 or d10 < 2:
            continue
        if month == (d1 * d10):
            ans +=1

print(ans)

Submission status: Accepted

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

if d >= 22:

    for mm in range(1,m+1,1):
        
        for dd in range (22,d+1):
            dd = str(dd)
            d10 = int(dd[0])
            d1 = int(dd[1])
            
            if d1>=2 and mm == d1*d10 :
                count +=1
print(count)

Submission status: Accepted

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

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

print(out)

Submission status: 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):
    d = str(d)
    if m == int(d[0])*int(d[1]) and int(d[0]) >= 2 and int(d[1]) >= 2:
      ans += 1
print(ans)

Submission status: Accepted

Solution code:
data = input().split(" ")
m = int(data[0])
d = int(data[1])
if d < 10:
	print(0)
else:
	d = str(d)
	d1 = int(d[0])
	d2 = int(d[1])
	ans = 0
	for i in range(2, d1):
		for j in range(0, 8):
			if i * (9-j) <= m:
				ans += 9-j-1
				break
	for j in range(0, d2-1):
		if d1 * (d2-j) <= m:
			ans += d2-j-1
			break
	print(ans)

Submission status: Accepted

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

def check(month,day):
	day_str = str(day)
	if len(day_str) < 2:
		return 0
	else:
		day1 = int(day_str[1])
		day10 = int(day_str[0])
		if day1 >= 2 and day10 >= 2 and month == day1 * day10:
			return 1
		else:
			return 0

cnt = 0
for i in range(1,m+1):
	for j in range(1,d+1):
		cnt += check(i,j)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

a = []
a = input().split()

M = int(a[0])
D = int(a[1])

count = 0

for i in range(M) :
	f = 22
	for j in range(D - 21) :
		if (f // 10)*(f % 10) == i + 1 :
			count = count + 1
			if (f // 10) == 1 or (f % 10) ==1 :
				count = count - 1
		f = f + 1

#print('M = ', M)
#print('D = ', D)
#print('count = ', count)

print(count)

Submission status: Accepted

Solution code:
# a = int(input())
# n, *a = map(int, open(0))
M, D = map(int, input().split())
# A = list(map(int, input().split()))
# S = input()
cnt = 0
for i in range(M+1):
    for j in range(D+1):
        m = i
        d_10 = j//10
        d_1 = j - d_10 * 10
        if d_10 > 1 and d_1 > 1 and m == d_10 * d_1:
            cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys 
m,d = map(int,input().split())
if m<=3:
  print(0)
  sys.exit()
cnt = 0
def make_d(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i and n//i != n:
        divisors.append(n//i)

  divisors.sort()
  return divisors
  
for i in range(4,m+1):
  l = make_d(i)
  l.pop(0)
  n = len(l)
  if not l:
    pass

  elif n%2 == 0:
    for x in range(n//2):
      if int(str(l[x])+str(l[-x-1])) <= d:
        cnt += 1

      if int(str(l[-x-1])+str(l[x])) <= d:
        cnt += 1  

  else:
    for x in range(n//2):
      if int(str(l[x])+str(l[-x-1])) <= d:
        cnt += 1

      if int(str(l[-x-1])+str(l[x])) <= d:
        cnt += 1
        
    if int(str(l[n//2])+str(l[n//2])) <= d:
      cnt += 1  
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

count = 0

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

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np
from operator import itemgetter

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

D10=D//10
D1=D%10

ans=0
for i in range(2,D10):
    for j in range(2,10):
        if i*j<=M:
            ans+=1
i=D10
if i < 2:
    print(0)
else:
    for j in range(2,D1):
        if i*j<=M:
            ans+=1

    j=D1
    if j>1:
        if i*j<=M:
            ans+=1
    print(ans)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
ans = 0
s = []
for i in range(4,M+1):
    for j in range(22,D+1):
         k = str(j)
         if  int(k[0])*int(k[1]) == i:
             ans += 1
             s.append(i)
             s.append(j)
ans_2 = ans
for i in range(len(s)//2):
    if s[i*2-1]%10 == 1 or s[1*2-1]//10 == 1:
        ans_2 -= 1
print(ans_2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

            if d1 >= 2 and d2 >= 2 and m == d1 * d2:
                ans += 1
                
    print(ans)

if __name__ == '__main__':
    p_a()

Submission status: Accepted

Solution code:
N, D = map(int, input().split())
day = 0
day10 = 0
ans =0
for j in range(4, N+1):
    for i in range(22, D+1):
        day = i % 10
        day10 = i//10
        if day >= 2 and day10 >=2:
          if j == day * day10:
              ans += 1

print(ans)

Submission status: Accepted

Solution code:
M, D = (int(x) for x in input().split())
ans = 0

M_list = list(range(1,M+1))
D_list = list(range(1,D+1))

for i in M_list:
    for j in D_list:
        if j // 10 >= 2:
            if j % 10 >= 2:
                if i == (j // 10) * (j % 10):
                    ans += 1
                    # print(str(i) + "月" + str(j) + "日")
print(ans)

Submission status: Accepted

Solution code:
import math


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

    count = 0
    
    for m in range(M):
        for i in range(D):
            d = str(i+1).zfill(2)
            x = int(d[0])
            y = int(d[1])

            if x * y == m+1:
                if x >= 2 and y >= 2:
                    count += 1
    print(count)

Submission status: Accepted

Solution code:
divisors = [[] for i in range(101)]

for i in range(4, 101):
	for j in range(2, 10):
		if i % j == 0 and (i//j)//10 == 0 and i//j >= 2:
			divisors[i].append([j, i//j])

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

count = 0
for i in range(4, M+1):
	for divisor in divisors[i]:
		if divisor[0]*10 + divisor[1] <= D:
			count += 1

print(count)

Submission status: Accepted

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

count = 0
for i in range(1,d+1):
    i1 = i % 10
    i2 = i // 10
    if i1 >= 2 and i2 >= 2 and i1 * i2 <= m and i1 * i2 >= 1:
        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):
    d10, d1 = j // 10,j % 10
    if d10 >= 2 and d1 >= 2:
      if i == d10*d1:
        cnt+=1
print(cnt)
#もし，dが22以上の時，

Submission status: Accepted

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

Submission status: Accepted

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

@author: Toroi0610
"""

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

M, D = map(int, input().split())
day = [str(d) for d in range(1, D+1)]
cnt = 0
for m in range(1, M+1):
    s = make_divisors(m)
    length = len(s)
    if length == 2:
        continue
    if length%2 == 0:
        for l, r in zip(s[:int(length/2)], s[int(length/2):][::-1]):
            if (l > 10) or (r > 10) or (l==1):
                continue
            else:
                if str(l)+str(r) in day:
                    cnt += 1
                if str(r)+str(l) in day:
                    cnt += 1
    else:
        for l, r in zip(s[:int(length/2)+1], s[int(length/2):][::-1]):
            if (l > 10) or (r > 10) or (l==1):
                continue
            else:
                if str(l)+str(r) in day:
                    cnt += 1
                if l != r:
                    if str(r)+str(l) in day:
                        cnt += 1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
 
M = A[0]
D = A[1]
count = 0
 
for i in range(4,M+1):
  for j in range(22,D+1):
    day = list(str(j))
    m10 = int(day[0])
    m1 = int(day[1])
    if m10 < 2:
      continue
    elif m1 < 2:
      continue
    
    if i == m10 * m1:
      count+=1
    
  
 
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
if d<22:
  print(0)
else:
  t=d//10
  o=d-(t*10)
  i=2
  ans=0
  k=2
  while i<t and i*2<=m:
    j=2
    while j*i<=m and j < 10:
      ans+=1
      j+=1
    i+=1
  while t*k<=m and k<=o:
    ans+=1
    k+=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):
        d10 = int(str(j)[0])
        d1 = int(str(j)[1])
        if i == d10*d1 and d10 >=2 and d1 >= 2:
            ans += 1
            #print(i, j)
            #print(d10, d1)
if D <= 9:
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
k = 0
m,d  = (int(i) for i in input().split()) 
listm = range(1,m + 1)
listd = range(1,d + 1)
for a in listm:
 for b in listd:
  if len(str(b)) >= 2:
   if int(str(b)[0]) >= 2:
    if int(str(b)[1]) >= 2:
       #print(a,"y",b,"d")
       if a == int(str(b)[0]) * int(str(b)[1]):
         #print(a,"y",b,"d")
         k = k + 1
print(k)

Submission status: Accepted

Solution code:
data = input().split(" ")

M = int(data[0])
D = int(data[1])


# 結果用変数
count = 0

# 1月からm月
for i in range(M):
    i += 1
    # 1日からd日
    for j in range(D):
        j += 1
        # 二桁チェック
        if j >= 10:
            d_1 = int(str(j)[:1])
            d_10 = int(str(j)[1:])
            if d_1 >= 2 and d_10 >= 2:
                if d_1 * d_10 == i:
                    count += 1
print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

c=0
for m in range(1,M+1):
    for d in range(1,D+1):
        if d>=10:
            t=str(d)
            if int(t[0])>1 and int(t[1])>1 and int(t[0])*int(t[1]) == m:
                c+=1

print(c)

Submission status: Accepted

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

count = 0

for day in range (2,d+1):
    for month in range(2,m+1):
        d_1 = day%10
        d_10 = day//10
        if ((d_1 * d_10) == month) and (d_1 >= 2) and(d_10 >= 2):
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# スペース区切りの整数の入力
M, D = map(int, input().split())

# 1-M月 1-D日
count = 0
m_list = []

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

    if d10 < 2:
        continue
    if d1 == 1:
        continue

    if d10 * d1 in range(1, M + 1):
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

seki = 0
for a in range(1, m + 1):
    for b in range(1, d + 1):
        if b < 10:
            continue
        c = list(map(int, list(str(b))))
        if c[0] >= 2 and c[1] >= 2 and c[0] * c[1] == a:
            seki += 1

print(seki)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

cnt = 0

if m <= 3 or d <= 21:
	print(0)
else:
	for i in range(22,d+1):
			d10 = int(i/10)
			d1 = int(i%10)
			# print(d1)
			# print(d10)
			if d1 >= 2 and d10 >= 2 and d1*d10  <= m:
				cnt += 1

	print(cnt)

Submission status: Accepted

Solution code:
def main () :

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

    if (D <= 10) :
        print("0")
        return
    
    count = 0
    for m in range(1,M+1) :
        for d in range(11, D+1) :
            str_d = str(d)
            d1 = int(str_d[0])
            d10 = int(str_d[1])

            if (d1 < 2 or d10 < 2) :
                continue

            if (m == d1 * d10) :
                count += 1
    
    print(count)






main()

Submission status: Accepted

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

M = int(i[0])
D = i[1]
a = [[j,k] for k in range(20,int(D)+1) for j in range(M+1)\
     if j == int(str(k)[0])*int(str(k)[1]) and int(str(k)[0]) >= 2 and int(str(k)[1]) >= 2]

print(len(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

# print(is_prime(53))    
# print(is_prime(84))


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

counter = 0





if D >= 22:
	for i in range(M):
		if not is_prime(i+1):
			for j in range(22,D+1):
			# 11~Dまでを見る
				j_0 = j%10
				j_1 = j//10

				if i+1 == j_0*j_1 and j_0 >= 2:
					counter += 1

print(counter)

Submission status: Accepted

Solution code:
m,d=[int(i) for i in input().split()]
k=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:
      k+=1
print(k)

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 < 100 and d >= 10:

            d10 = d // 10
            d1  = d % 10

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

                ans += 1

print (ans)

Submission status: Accepted

Solution code:
H = list(map(int, input().split()))
count = 0

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

print(count)

Submission status: Accepted

Solution code:
# Takahashi Calender

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

for cm in range(1, m+1):
    for cd in range(21, d + 1):
        if (cd // 10) * (cd % 10) == cm and cd % 10 > 1:
            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):
        j = str(j).zfill(2)
        if int(j[0]) >= 2 and int(j[1]) >= 2:
            if int(j[0]) * int(j[1]) == i:
                ans += 1
            
print(ans)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
count=0
for m in range(M):
    month=m+1
    for d in range(D):
        day=d+1
        if day//10>0:
            a,b=map(int,list(str(day)))
            if month==a*b and a>1 and b>1:
                count+=1
print(count)

Submission status: Accepted

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

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

count = 0

for m in range(1, m + 1):
    for n in range(22, d + 1):
        a = list(map(int, str(n)))
        if m == a[0] * a[1] and a[0] >= 2 and a[1] >= 2:
            count += 1

print(count)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
count = 0
for m in range(M, 0, -1):
  if m >= 4:
    for day in range(D, 0, -1):
      d2 = day // 10
      d1 = day - d2 * 10
      if d2 >= 2:
        if d1 >= 2:
          if d1 * d2 == m:
            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):
        if (j%10)==1:
            pass
        elif i==((j-j%10)/10*(j%10)):
            count+=1
          
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys

def main() -> int:
    [m, d] = [int(x) for x in sys.stdin.read().split(' ')]
    # 因数分解するよりはかけてしまったほうがはやそう
    ms = [mul(x) for x in range(1, d + 1)]
    months = set(range(1, m + 1))
    ans = len([x for x in ms if x in months])
    print(ans)
    return 0

def mul(x):
    a = int(x // 10)
    b = int(x % 10)
    if a < 2 or b < 2: return 0
    return a * b


if __name__ == "__main__":
    exit(main())

# vim:fenc=utf-8 ff=unix ft=python ts=4 sw=4 sts=4 fdm=indent fdl=0 fdn=1:
# vim: si et cinw=if,elif,else,for,while,try,except,finally,def,class:

Submission status: Accepted

Solution code:
a,b = [int(s) for s in input().split()]
count = 0
for j in range(a):
  j += 1
  for i in range(b):
    i += 1
    if i <= 20:
      pass
    else:
      p = i % 10
      q = int((i - p)/10)
      if j == p * q and p != 1:
        count += 1
print(count)

Submission status: Accepted

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


def is_prime(n):
    a = []
    for i in range(2, n+1):
        for k in range(2, int(math.sqrt(i)) + 1):
            if i % k == 0:
                a.append(i)
                break

    return a

lis = is_prime(M)
b = 0

if D <22:
    print(0)
else:
    for m in lis:
        for i in range(22, D+1):
            b1 = i%10
            b10 = i//10
            if b1 != 1 and b10 != 1 and b1 * b10 == m:
                b +=1
    print(b)

Submission status: Accepted

Solution code:
list = input().split()
M = int(list[0])
D = int(list[1])

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(int, input().split())) 
result = []
month = s[0]

m = list(range(4,month + 1))

day= s[1]
count = 0

for i in range(2,day + 1):
    d1 = i % 10
    d2 = i//10
    if (d1 >= 2) and (d2 >=2):
        if d1 * d2 in m:
            count +=1
print(count)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
ans=0
for a in range(1,m+1):
    for i in range(1,d+1):
        c=i
        y=c%10
        c//=10
        x=c%10
        if x>=2 and y>=2 and x*y==a:
            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 day in range(1,d+1):
        d_1  = day%10
        d_10 = day//10
        if (d_1>=2 and d_10>=2):
            if d_1 * d_10 == month:
                count = count + 1
        else:
            pass
        
print(count)

Submission status: Accepted

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

                    
                    
print(count)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
counter=0
for i in range(1,M+1):
    for j in range(1,D+1):

        if j<10:
            continue
        else:
            k=str(j)
            if int(k[0])>=2 and int(k[1])>=2:
                if int(k[0])*int(k[1])==i:

                    counter+=1
print(counter)

Submission status: Accepted

Solution code:
md = input().split()

m = int(md[0])
d = int(md[1])

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

print(ans)

Submission status: Accepted

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

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

for m in range(1, M+1):
  for d in range(20, D+1):
    dstr = str(d)
    if int(dstr[1]) < 2:
      continue
    if int(dstr[0]) * int(dstr[1]) == m:
      ans += 1

print(ans)