Problem:


Score : 200 points

Problem Statement

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

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

d_1 \geq 2

d_{10} \geq 2

d_1 \times d_{10} = m

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

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

Constraints

All values in input are integers.

1 \leq M \leq 100

1 \leq D \leq 99

Input

Input is given from Standard Input in the following format:

M D

Output

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

Sample Input 1

15 40

Sample Output 1

10

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

4-22

6-23

6-32

8-24

9-33

10-25

12-26

12-34

14-27

15-35

Sample Input 2

12 31

Sample Output 2

5

Sample Input 3

1 1

Sample Output 3

0



Sample input:
15 40


Sample output:
10

Submission status: Accepted

Solution code:
from collections import defaultdict
from heapq import heappush, heappop
import math
import bisect
import random

def LI(): return list(map(int, input().split()))
def I(): return int(input())
def LIM(): return list(map(lambda x:int(x) - 1, input().split()))
def LS(): return input().split()
def S(): return input()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
mod = 1000000007


m, d = LI()


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




print(cnt)

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:
            d10 = int(str(d)[0])
            d1 = int(str(d)[1])
            if d10 >= 2 and d1 >= 2:
                if d10 * d1 == m:
                    cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a=input().split(" ")
M=int(a[0])
D=int(a[1])
list=[]
count=0
for p in range(4,M+1):
    list.append(p)
for q in range(22,D+1):
    d10=q//10
    d1=q-d10*10
    if d1>=2 and d10>=2:
        if d1*d10 in list:
            count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve
ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        d = str(j)
        if len(d) == 2:
            d1 = int(d[1])
            d10 = int(d[0])
            if d1 >= 2 and d10 >= 2 and d1 * d10 == i:
                ans += 1

# output
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(1,D+1):
        if j>=22:
            d1 = int(str(j)[-1])
            d10 = int(str(j)[-2])
            if d1>=2 and d10>=2 and i==d1*d10:
#                 print(i,d1,d10)
                cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m,d = map(int,raw_input().split())
c = 0
for i in xrange(1,m+1):
	for j in xrange(1,d+1):
		if j >= 20 and j%10 >= 2:
			if (j/10) * (j%10) == i:
				c += 1
				#print i,j
print c

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for m in range(1, M+1):
    for d in range(20, D + 1):
        a, b = map(int, str(d))
        if b < 2:
            continue
        elif m == a*b:
            ans += 1


print(ans)

Submission status: Accepted

Solution code:
m, d = map(int, input().split())
c = 0
a = set()
for i in range(2, m):
    for j in range(2, m):
        if i * j <= m and int(str(i)+str(j)) <= d:
            a.add((i*j, i, j))
print(len(a))

Submission status: Accepted

Solution code:
def main():
    md = [int(x) for x in input().split()]
    ret = 0
    for i in range(md[0]):
        for j in range(md[1]):
            d = [(1+j) % 10, (1+j)//10]
            if d[0] >= 2 and d[1] >= 2 and d[0] * d[1] == i+1:
                # print(i+1, j+1)
                ret += 1
    print(ret)
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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


print(count)

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):
        d10, d1 = d // 10, d % 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == m:
            ans += 1

print(ans)

Submission status: Accepted

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

print(cnt)

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-d1)/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())
c = 0
for d in range(20,D+1):
    s = str(d)
    if (1<int(s[0])*int(s[1])<=M and int(s[0]) > 1 and int(s[1]) > 1):
        c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 18
MOD = 10 ** 9 + 7


def LI():
    return list(map(int, sys.stdin.readline().split()))


def II():
    return int(sys.stdin.readline())


def LS():
    return list(map(list, sys.stdin.readline().split()))


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


def main():
    m, d = LI()
    ans = 0
    for i in range(2, m + 1):
        for j in range(2, d + 1):
            if j < 20:
                continue
            jj = int(j / 10)
            jjj = j - 10 * jj
            if jjj < 2:
                continue
            if i == jj * jjj:

                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
flag=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 and int(str(j)[0])*int(str(j)[1])==i:
    flag+=1
print(flag)

Submission status: Accepted

Solution code:
[M,D]=list(map(int,input().split()))
count=0
for MM in range(1,1+M):
    for DD in range(1,1+D):
        d10=DD//10
        d1=DD%10
        if d1>=2 and d10 >= 2 and d1*d10==MM:
            count+=1
print(count)

Submission status: Accepted

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

ans = 0
for di in range(11, D + 1):
    d10 = di // 10
    d1 = di % 10
    if d10 < 2: continue
    if d1 < 2: continue
    #
    if 1 <= (d1 * d10) <= M:
        # print("#", d1, d10)
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    f_a()

Submission status: Accepted

Solution code:
import bisect
from collections import deque
import sys
MAX_INT = int(10e9)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

M,D = IL()

cnt = 0
for m in range(1,M+1):
  d2 = 0
  for d in range(20,D+1):
    d1 = str(d)[-1]
    d10 = str(d)[-2]
    if (int(d1) >= 2) and (int(d10) >= 2) and (int(d1)*int(d10) == m):
      cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
# M,D=15,40
# M,D = 100,99
ls = []
for i in range(2,10):
    for j in range(2,10):
        if i*10+j <= D:
            ls.append((i*j,i,j))
ls = list(sorted(ls))
r = []
for lls in ls:
    if lls[0] > M:
        break
    r.append(lls)
# print(r)
print(len(r))

Submission status: Accepted

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

ans = 0
if(D < 20):
    print(0)
    sys.exit()

for i in range(1,M+1):
    for j in range(20,D+1):
        d10 = j//10
        d1  = j%10
        if(d1 < 2):
            continue
        elif(i == d10 * d1):
            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(min(22, d), d + 1):
        if j // 10 * (j % 10) == i and j % 10 > 1:
            # print(j// 10, j % 10, i)
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
#coding:utf-8

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

count = 0

for i in range(1, M+1):
    for j in range(1, D+1):
        d = '%02d'%(j)
        d_1 = int(d[1])
        d_10 = int(d[0])
        if d_1 >=2 and d_10 >=2 and d_1 * d_10==i:
            count += 1
print(count)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    M, D = [int(i) for i in input().split()]
    cnt = 0
    for m in range(2, M + 1):
        for d in range(22, D + 1):
            d_one = d % 10
            d_ten = d // 10
            if d_one < 2 or d_ten < 2:
                continue
            if m == d_one * d_ten:
                cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
ans = 0
for j in range(M):
  L = j + 1
  for i in range(D):
    K = i + 1
    if K > 9:
      P = str(K)
      if int(P[0]) != 1 and int(P[1]) != 1:
        if int(P[0])*int(P[1]) == L:
          
          ans += 1
print(ans)

Submission status: Accepted

Solution code:

def main():
    m, d = map(int, input().split(" "))
    count = 0
    for m in range(1, m+1):
        for day in range(1, d+1):
            d1 = day % 10
            d10 = (day - d1) // 10
            if d1>=2 and d10 >=2 and d1*d10==m:
                count += 1

    print(count)

main()

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())
ans = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        if (j//10) * (j%10) == i and j//10 >= 2 and j%10 >= 2:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        if len(str(d)) == 1:
            continue
        else:
            d1 = int(str(d)[0])
            d2 = int(str(d)[1])
            if d1*d2 == m and d1 >= 2 and d2 >= 2:
                ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
M, D = [int(x) for x in input().split(' ')]
ret = 0

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

Submission status: Accepted

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

ans = 0

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


print(ans)

Submission status: Accepted

Solution code:
M, D = [int(x) for x in input().split()]
ret = 0
for m in range(1, M+1):
  for d10 in range(2, 10):
    for d1 in range(2, 10):
      d = 10 * d10 + d1
      if d > D:
        break
      if d1 * d10 == m:
        ret += 1
    if d10 > D:
      break
print(ret)

Submission status: Accepted

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

cnt = 0
for iM in range(1, M+1):
    for iD in range(1, D+1):
        d1 = iD % 10
        d10 = iD // 10
        if d1 == 1 or d10 == 1:
            continue
        if d1 * d10 == iM:
            cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for d in range(22,D+1):
    d10 = d // 10
    d1 = d % 10
#    print(str(d10)+','+str(d1))
    if d10 >= 2 and d1 >= 2:
        if d1 * d10 <= M:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: 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(1,d+1) :
		one = j % 10;
		ten = j // 10;
		if ten >= 2 and one >= 2 and ten * one == i :
			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(1, d + 1):
        # print(i, j)
        if j % 10 >= 2 and (j // 10) >= 2 and j % 10 * (j // 10) == i:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b = readmi()

su = 0
for i in range(1, a + 1):
    for j in range(10, b + 1):
        t = str(j)
        tt = list(t)
        if int(tt[0]) >= 2 and int(tt[1]) >= 2:
            if i == int(tt[0]) * int(tt[1]):
                su += 1
print(su)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M, D  = [int(v) for v in raw_input().split()]
p = 0
for m in range(1, M+1):
    for d in range(22, D + 1):
        d1 = d %10
        d10 = (d //10) % 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == m:
            p += 1
           # print('{}-{}'.format(m, d))
print(p)

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

Submission status: Accepted

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

res = 0
for m in range(1,M+1):
    for d in range(10,D+1):
        d = str(d)
        c = 1
        for x in d:
            x = int(x)
            if x < 2:
                x = 0
            c *= x
        if c == m:
            res += 1
print(res)

Submission status: Accepted

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

c = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        D01 = j % 10
        D10 = j // 10
        if D01 >= 2 and D10 >= 2:
            if D01 * D10 == i:
                c += 1

print(c)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

product = 0

for i in range(1,M+1):
    for j in range(1, D+1):
        d1 = int(str(j)[0])
        d10 = 0
        if len(str(j)) != 1:
            d10 = int(str(j)[1])
            
        if d1 >= 2 and d10 >= 2 and d1*d10 == i:
            product += 1

print(product)

Submission status: Accepted

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

Submission status: Accepted

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

def is_seki(m, dd):
    d1 = dd % 10
    d10 = dd // 10
    return all([d1 >= 2, d10 >= 2, d1 * d10 == m])

res = 0
for m in range(1, M+1):
    for dd in range(1, D+1):
        if is_seki(m, dd):
            res += 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

count = 0

for i in range(1, m + 1):
    for j in range(22, d + 1):
        op = j % 10
        tp = j // 10
        if op >= 2 and tp >= 2 and i == op * tp:
            # print("M{}, {} {}".format(i, op, tp))
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m, d = (int(i) for i in input().split())
count = 0
for month in range(2, m+1):
    for day in range(2, 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 += 1
print(count)

Submission status: Accepted

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

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

        ans += int(d1 * d10 == m)
print(ans)

Submission status: Accepted

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

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(1, d+1):
        if j >= 20 and j%10 >= 2 and i == (j%10) * (j//10):
            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)

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

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

cnt = 0

for i in range(1, M+1):
    for j in range(1, D+1):
        if j < 10:
            continue

        s = str(j)
        d10 = int(s[0])
        d1 = int(s[1])

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3


l=input()
M,D=l.split(" ")
M=int(M)
D=int(D)


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

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

print(cnt)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    M, D = map(int, input().split())
    cnt = 0
    for m in range(1, M+1):
        for d in range(1, D+1):
            d1 = d % 10
            d10 = d // 10
            if min(d1, d10) < 2:
                continue
            if d1 * d10 == m:
                cnt += 1

    return cnt


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
Mod = 1000000007




def main(): #startline-------------------------------------------
    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:
                continue
            else:
                p = [k for k in str(j)]
                if int(p[0])<2 or int(p[1])<2:
                    continue
                elif int(p[0])*int(p[1]) == i:
                    ans += 1
    print(ans)
if __name__ == "__main__":
    main() #endline===============================================





def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

Submission status: Accepted

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


def solve(M: int, D: int):
    count = 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_1 >= 2 and d_10 >= 2 and d_1*d_10 == m:
                count += 1
    print(count)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    M = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(M, D)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

count=0

i=10
while i<D+1:
  if D<10:break
  temp=str(i)
  d1=int(temp[0])
  d2=int(temp[1])
  if d1*d2<=M and d1>1 and d2>1:
    count+=1
    #print(d1,d2)
  
  i=i+1
  
print(count)

Submission status: Accepted

Solution code:
# m = map(int, raw_input().split())
n,m = map(int, raw_input().split())
ans = 0
for i in xrange(1,n+1):
  for j in xrange(1,m+1):
    ten = j/10
    one = j%10
    if j < 22 or ten < 2 or one < 2:
      continue
    if j/10 * (j%10) == i:
      ans += 1
print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,M = map(int,input().split())
ans = 0
for n in range(1,N + 1):
        for m in range(1,M + 1):
                m = str(m)
                if len(m) == 1:
                        continue
                if int(m[1]) < 2 or int(m[0]) < 2:
                        continue
                if n == int(m[0]) * int(m[1]):
                        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def solve():
    M, D = map(int, input().split())
    res = 0 
    for i in range(1,D+1):
        if (i//10)>=2 and (i%10)>= 2 and 1 <= (i//10)*(i%10) <= M:
            res += 1
    return str(res)

if __name__ == '__main__':
    print(solve())

Submission status: Accepted

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

result = 0
if d < 12:
    print(0)
    exit()
for i in range(1, m+1):
    for j in range(12, d+1):
        a1 = j % 10
        ba10 = j // 10
        if a1 >= 2 and ba10 >= 2:
            if i == a1 * ba10:
                result+=1

print(result)

Submission status: Accepted

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

c=0

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

print(c)

Submission status: Accepted

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

if D <= 21:
    print(0)
else:
    ans = 0
    for i in range(22, D+1):
        a = int(str(i)[0])
        b = int(str(i)[1])
        if a * b <= M and a >= 2 and b >= 2:
            ans += 1
    print(ans)

Submission status: Accepted

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

cnt = 0
for month in range(1, m + 1):
    for x in range(20, d+1):
        d10 = x // 10
        d1 = x % 10
        if d10 * d1 == month and d1 != 1:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
res = 0
for i in range(1, D + 1):
  for j in range(1, M + 1):
    if i < 10:
      continue
    n = list(str(i))
    if int(n[0]) < 2 or int(n[1]) < 2:
      continue
    if int(n[0]) * int(n[1]) == j:
      res += 1
print(res)

Submission status: Accepted

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