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());c=0
for i in range(d+1):
	if (i//10>1)&(i%10>1):
		s,t=str(i)
		if  int(s)*int(t)<=m:
			c+=1
print(c)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/jsc2019-qual/tasks/jsc2019_qual_a

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

def main():
    m, d = map(int, input().split())
    ans = 0
    for i in range(1, m + 1):
        for j in range(10, d + 1):
            d1 = int(str(j)[1])
            d10 = int(str(j)[0])
            if d1 < 2 or d10 < 2:
                continue
            if i == d1 * d10:
                # print('{} {} {}'.format(i, d10, d1))
                ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#import pysnooper
#import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

m,d=map(int,input().split())
ans=0
for month in range(1,m+1):
    for day in range(1,d+1):
        s=str(day)
        if len(s)==1:
            continue
        if int(s[0])>=2 and int(s[1])>=2 and int(s[0])*int(s[1])==month:
            #print(month,day)
            ans+=1
print(ans)

Submission status: Accepted

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

count = 0
for d in range(22, D+1):
    d10 = int(d / 10)
    d1 = d - d10 * 10
    if (d1 >= 2) and (d10 >= 2) and (M >= d10 * d1):
        count += 1

print(count)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
m_list = {m for m in range(1, M + 1)}
ans = 0
 
for d in range(11, D+1):
  d_10 = int(d/10)
  d_1 = d - (d_10 * 10)
  if (d_10 < 2) or (d_1 < 2):
    continue
  else:
    if (d_10 * d_1) in m_list:
      ans += 1
      
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    a = list(map(int, input().split()))

    total = a[0]*a[1]

    count = 0
    for i in range(a[0]):
        for j in range(a[1]):
            if ((j+1)%10) >= 2 and ((1+j)//10) >= 2: 
                if (i+1) == ((j+1)%10)*((j+1)//10):
                    count += 1

    print(count)




if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import *
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    m, d = LI()
    ans = 0
    for i in range(1, m + 1):
        for j in range(10, d + 1):
            if int(str(j)[0]) < 2 or int(str(j)[1]) < 2:
                continue
            if i == int(str(j)[0]) * int(str(j)[1]):
                ans += 1
    print(ans)
    return

#B
def B():
    n, l = LI()
    a = LI()
    d0 = defaultdict(int)
    d1 = defaultdict(int)
    for i in a:
        d0[i] += 1
    for i in range(n):
        b = 0
        for k in range(i+1, n):
            if a[i] > a[k]:
                b += 1
        d1[i] = b
    ans = 0
    d2 = list(d0.items())
    d2.sort()
    d3 = defaultdict(int)
    d = 0
    for key, value in d2:
        d3[key] = d
        d += value
    print(d3,d1)
    for i in range(n):
        ans += d3[a[i]] * l * (l-1) // 2 + d1[i] * l
        ans %= mod
    print(ans % mod)
    return

#C
def C():
    n = II()
    s = itertools.product([1, 0], repeat=2 * n)
    a = list(itertools.combinations(range(2*n), 2))
    d = defaultdict(int)
    def dfs(a):
        if len(a) == n:
            lis.append(a)
            return True
        for i in range(n):
            if d[i] == 0:
                d[i] = 1
                for k in range(n):
                    if d[k] == 0:
                        d[k] = 1
                        a.append((i, k))
                        dfs(a)
                        a.remove((i, k))
    lis = []
    dfs([])
    for si in s:
        for di in lis:
            b = list(si[::1])
            for x, y in di:
                for i in range(x, y + 1):
                    b[i] ^= 1
            if sum(b) < 1:
                print(si, di)
                break

    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()

Submission status: Accepted

Solution code:
tmp = [int(i) for i in input().split()]
M, D = tmp[0], tmp[1]
if D < 22 or M < 4:
  print(0)
else:
  days = [(str(i)[0], str(i)[1]) for i in range(22,  D+1) if int(str(i)[0])>1 and int(str(i)[1])>1]
  n = 0
  print(sum([1 for m in range(4, M+1) for d in days if m == int(d[0])*int(d[1])]))

Submission status: Accepted

Solution code:
M,D = map(int, input().split())
if M < 4 or D < 22:
    print(0)
else:
    result=0
    for m in range(4,M+1):
        for d in range(22,D+1):
            if int(str(d)[0]) >= 2 and int(str(d)[1]) >= 2 and int(str(d)[0])*int(str(d)[1])==m:
                result += 1
    print(result)

Submission status: Accepted

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

ans = 0
for i in range(2,M+1):
  for d10 in range(2,int(D_array[0])+1):
    for d1 in range(2,10):
      if int(str(d10)+str(d1)) <= D:
        if int(d1)*int(d10) == i:
          ans += 1
print(ans)

Submission status: Accepted

Solution code:
def check(m,d1,d10):
    if (d10>=2):
        if(d1>=2):
            if (d1*d10==m):
                return 1
    return 0
    
(M,D)=list(map(int,input().split()))
count=0
for m in range(1,M+1):
    for d in range(1,D+1):
        copy=d
        d1=copy%10
        copy=int(copy/10)
        d10=copy%10
        result=check(m,d1,d10)
        if(result==1):
            count=count+1
print(count)

Submission status: Accepted

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

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

    divs.sort()
    return divs

cnt = 0

for m in range(1, md[0]+1):
    divs = divisors(m)

    for d in divs:
        if d >= 2 and d != m and m/d < 10 and d*10 + m/d <= md[1]:
            cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = input().split(" ")
#print(num)
#print(num[0],num[1])
cnt=0
for i in range(1,int(num[1])+1):
    for j in range(1,int(num[0])+1):
        if i<=9 or  i%10==1 or i//10==1:
          pass
        elif (i//10)*(i%10)==j:
            cnt = cnt+1
        else:
            pass
print(cnt)

Submission status: Accepted

Solution code:
m, d = map(int,input().split())
count = 0
for i in range(4,m+1):
    for k in range(22,d+1):
        if (k//10)*(k%10) == i:
            if not k%10 == 1:
                count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tmp = input().split()
m = tmp[0]
d = tmp[1]

if 1 <= int(m) and int(m) <= 100:
    if 1 <= int(d) and int(d) <= 99:
        count = 0
        for i in range(1, int(d)+1):
            if len(str(i)) == 2:
                d1 = int(str(i)[0])
                d2 = int(str(i)[1])
                if d1 >= 2 and d2 >= 2:
                    tmp = d1 * d2
                    # print(tmp)
                    if tmp in range(1, int(m)+1):
                        # print(i)
                        count += 1
        print(count)

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    M, D = map(int, input().split())
    
    counter = 0
    for i in range(10, D + 1):
        d1 = i % 10
        d2 = int(i // 10)
        
        
        if d1 >= 2 and d2 >= 2 and d1 * d2 <= M:
            logging.info(str(d1) + " " + str(d2))
            counter += 1
            

    
    print(counter)
    
    logging.info("Hello!")

    
    
    
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):
        d_10=j//10
        d_1=j%10
        if (d_1>=2)&(d_10>=2):
            if i==d_10*d_1:
                cnt+=1
print(cnt)

Submission status: Accepted

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

ans=0
ansli=[]
for ii in range(a):
    i=ii+1
    for jj in range(b):
        j=jj+1
        if(j//10>=2 and j%10>=2 and (j//10)*(j%10)==i):
            ans+=1
            ansli.append([i,j])
            
print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
count = 0
if D < 22:
    print(0)
else:
    a = D // 10
    b = D - a * 10
    if b < 2:
        a -= 1
        b = 9 
    for i in range(2, a):
        for j in range(2, 10):
            if i * j <= M and i * j >= 4:
                count += 1
    for k in range(2, b+1):
        if a * k <= M and a * k >= 4:
            count += 1
    print(count)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
M, D = map(int,input().split())
D10 = D//10
D1 = D%10
count = 0
for i in range(21,D+1):
    i10 = i//10
    i1 = i%10
    if i10<2 or i1<2:
        count+=0
    elif i10*i1<=M:
        count +=1
print(count)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
result=0
 
for i in range(2,D//10+1):
  if i<D//10:
    result+=max(min(M//i,9)-1,0)
    #print(i,min(M//i,9)-1)
  else:
    if D%10>=2:
      result+=max(min(M//i,D%10)-1,0)
      #print(i,min(M//i,D%10)-1)
print(result)

Submission status: Accepted

Solution code:
M, D = [int(n) for n in input().split()]
c = 0
for m in range(1, M+1):
  for d in range(1, D+1):
    if d <= 9:
        d10 = 0
        d1 = d
    else:
        d10, d1 = [int(n) for n in list(str(d))]
    if m == d10*d1 and d10 >=2 and d1 >=2:
        c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  m, d = map(int, input().split())
  result = 0
  for i in range(m):
    for j in range(d):
      tmp = seki(j+1)
      if tmp:
        if (i+1 == tmp):
          result += 1
  print(result)

def seki(day):
  if day < 10:
    return None
  d1 = day % 10
  d10 = day // 10
  if (d1 < 2 or d10 < 2):
    return None
  return d1 * d10 
      
main()

Submission status: Accepted

Solution code:
tmp = [int(i) for i in input().split()]
M, D = tmp[0], tmp[1]
if D < 22 or M < 4:
  print(0)
else:
  days = [(str(i)[0], str(i)[1]) for i in range(22,  D+1) if int(str(i)[0])>1 and int(str(i)[1])>1]

  n = 0
  for m in range(4, M+1):
      for d in days:
          if m == int(d[0])*int(d[1]):
              n +=1
  print(n)

Submission status: Accepted

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

if M <= 3 or D < 22:
    print(result)
else:
    if M > 81:
        M = 81
    for i in range(3, M):
        i += 1
        for j in range(21, D):
            j += 1
            D1 = j % 10
            D10 = j // 10
            if D1 < 2:
                continue
            if i == D1 * D10:
                result += 1
    print(result)

Submission status: Accepted

Solution code:
import sys

#+++++

def reg(i):
	d1 = i // 10
	d2 = i % 10
	if d1 < 2 or d2 < 2:
		return -1
	else:
		return d1 * d2

def main():
	m , d = map(int, input().split())
	
	ret=0
	for i in range(1,d+1):
		aa= reg(i)
		if aa == -1:
			continue
		if aa <= m:
			ret += 1
	print(ret)
	
	
#+++++


if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
import sys

childs = list(map(int, input().split()))

A=childs[0]
B=childs[1]
res=0
if A<=3 or B<=21:
    print(0)
    sys.exit()
else:
    for n in range(4, A+1):
        for i in range(2, int(n**0.5)+1):
            if n % i == 0:
                if 10*i+n//i <= B and 10*i+n//i >= 22 and n//i >=2 and n//i <= 9 and i<=9:
                    res+=1
                if i != n // i:
                    if 10*(n//i)+i <= B and  10*(n//i)+i >= 22:
                        res+=1
print(res)

Submission status: Accepted

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

Submission status: Accepted

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


for i in range(M+1):
    for j in range(D+1):
        if len(str(j)) >= 2:
            aaa=str(j)[-1]
            bbb=str(j)[-2]
            if int(aaa) >= 2 and int(bbb) >= 2 and int(aaa)*int(bbb) == i :
                cnt +=1
        else:
            pass
print(cnt)

Submission status: Accepted

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

count = 0
for a in range(1, M+1):
    for b in range(22, D+1):
        d10, d1 = int(str(b)[0]), int(str(b)[1])
        if d10 >= 2 and d1 >= 2 and d10*d1 == a:
            count += 1
            
    
    
print(count)

Submission status: Accepted

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

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):
    d_1 = int(str(d)[1])
    d_10 = int(str(d)[0])
    if d_1>=2:
      if d_1*d_10==m:
      	c += 1
        
print(c)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
if 22>d:
    print(0)
else:
    a=22
    ans=0
    while d>=a:
        b=str(a)
        if 2>int(b[0]) or 2>int(b[1]):
            a+=1
        else:
            if m >= int(b[0])*int(b[1]):
                ans+=1
                a+=1
            else:
                a+=1
    print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
if D <= 20 :
  X = 0
else :
  X = 0
  for i in range(D-20):
    if (i+21)%10 == 1:
      X += 0
    else : 
      s = str(i+21)
      A = int(s[0]) * int(s[1])
      if (A <= M) and (A != 0) :
        X += 1
      else :
        X += 0
print(X)

Submission status: Accepted

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

ans = 0

for i in range(d+1):
    d1 = i%10
    d10 = (i//10)%10
    #print(d1,d10)
    if d1 < 2 or d10 < 2:
        continue
    if d1 * d10 <= m:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
m,d=map(int,input().split())
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

ans=0
for i in range(1,m+1):
    Div=make_divisors(i)
    D=[]
    for k in Div:
        if 1<k<10:
            D.append(k)
    for k in D:
        day=k*10+(i//k)
        if 1<i//k<10 and day<=d:
            ans+=1
print(ans)

Submission status: Accepted

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

ans = 0
for i in range(1, m+1):
    for j in range(1, d+1):
        if not "1" in str(j) and (j%10)*(j//10) == i:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
x=0
for i in range(1,a+1):
  for j in range(11,b+1):
    lst = []
    while j > 0:
      lst.append(j%10)
      j //= 10
    lst.reverse()
    if lst[0] >= 2 and lst[1] >= 2:
      if i == lst[0]*lst[1]:
        x+=1
print(x)

Submission status: Accepted

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

count = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        d_str = str(d).zfill(2)
        d10 = int(d_str[0])
        d1 = int(d_str[1])
        if d1 >= 2 and d10 >= 2 and d1 * d10 == m:
            count += 1

print(count)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
ans=0
if D<21:
    print(ans)
    
else:
    for i in range(22,D+1):
        d1=i%10
        d10=(i-d1)/10
        if d1<2 or d10<2:
            pass
        else:
            if 2<=d1*d10<=M:
                ans+=1
            else:
                pass
    print(ans)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
result = 0
if d <= 21:
    print(0)
    exit()
else:
    for month in range(4,m+1):
        for day in range(22,d+1):
            d10 = int(str(day)[0])
            d1 = int(str(day)[1])
            if d1 >= 2 and d10 >= 2:
                if month == d10*d1:
                    result += 1
    print(result)

Submission status: Accepted

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

ans = 0;

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

print(ans)

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 - d % 10)/10
    if d1 < 2 or d2 < 2:continue
    elif d1 * d2 <= M:
        count += 1
print(count)

Submission status: Accepted

Solution code:
M,D = map(int,input().split(' '))
if M <= 3 or D <= 21:
  print(0)
  exit()
num = 0
for m in range(4,M+1):
  for d in range(21,D+1):
    X = str(d)
    if int(X[1]) <= 1:
      pass
    elif int(X[0]) * int(X[1]) == m:
      num += 1
print(num)

Submission status: Accepted

Solution code:
while True:
    MAPS = {'22': 4, '23': 6, '24': 8, '25': 10, '26': 12, '27': 14, '28': 16, '29': 18, '32': 6, '33': 9, '34': 12, '35': 15, '36': 18, '37': 21, '38': 24, '39': 27, '42': 8, '43': 12, '44': 16, '45': 20, '46': 24, '47': 28, '48': 32, '49': 36, '52': 10, '53': 15, '54': 20, '55': 25, '56': 30, '57': 35, '58': 40, '59': 45, '62': 12, '63': 18, '64': 24, '65': 30, '66': 36, '67': 42, '68': 48, '69': 54, '72': 14, '73': 21, '74': 28, '75': 35, '76': 42, '77': 49, '78': 56, '79': 63, '82': 16, '83': 24, '84': 32, '85': 40, '86': 48, '87': 56, '88': 64, '89': 72, '92': 18, '93': 27, '94': 36, '95': 45, '96': 54, '97': 63, '98': 72, '99': 81}
    try:
        M, D = map(int, input().split())
        result = 0
        if D >= 22:
            for i in range(22, D+1):
                i = str(i)
                mm = MAPS[i] if i in MAPS else None
                if mm is not None and mm <= M:
                    result += 1
        print(result)

    except EOFError:
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
W=M+1
if D<=21:
  print(0)
if 29>=D>=22:
  d1=D%10
  d10=D//10
  q=[x*y for x in range(2,d1+1) for y in range(2,d10+1)]
  DDD=([q.count(i) for i in range(1,M+1)])
  RR=sum(DDD)
  print(RR)
if 30<=D:
    d1=D%10
    d10=D//10
    qq=[x*y for x in range(2,d10) for y in range(2,10)]
    qqq=[d10*w for w in range(2,d1+1)]
    Q=[qq.count(j)for j in range(1,M+1)]+[qqq.count(j)for j in range(1,M+1)]
    DD=sum(Q)
    print(DD)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
my_list = []
for i in range(1, D + 1): 
    new = []
    number = list(str(i))
    for t in range(0, len(number)):
        new.append(int(number[t]))
    if len(new) == 1:
        continue
    else:
        if new[0] >= 2 and new[1] >= 2:
            for k in range(1, M + 1): 
                if k == (new[0] * new[1]):
                    my_list.append(k)
                    my_list.append(i)
                else:
                    continue
        else:
            continue
print(int(len(my_list) / 2))

Submission status: Accepted

Solution code:
M,D = map(int, input().split())
count = 0
l = [d for d in range(D+1) if d//10>=2 and d%10>=2]
for i in range(M+1):
  for j in l:
    if (j//10)*(j%10)==i:
      count+=1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
month_list = range(0, m+1, 1)
days_list = range(0, d+1, 1)
seki_list =[]
for m in month_list:
    for d in days_list:
        if d >=20 :
            day_list = digit(d)
            if int(day_list[0]) >= 2 and int(day_list[1]) >= 2:
                if (int(day_list[0])* int(day_list[1])) == m:
                    seki_list.append("hoge")

print(len(seki_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(1, M+1):
    di = len(str(i))
    for j in range(1, D+1):
        d_10 = j // 10
        d_1 = j % 10
        if d_10 >= 2 and d_1 >= 2 and d_10 * d_1 == i:
            count += 1

print(count)

Submission status: Accepted

Solution code:
M, D  = map(int, input().split())
cnt = 0
for i in range(D+1):
    str = "{:02d}".format(i)
    # print(str)
    d1 = str[0]
    d2 = str[1]
    if int(d1)*int(d2) <= M and int(d1)>=2 and int(d2)>=2:
        cnt += 1
        # print(int(d1)*int(d2),d1+d2)
        # print(str)
print(cnt)

Submission status: Accepted

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

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


d1=D // 10
d2=D % 10

count=0

for m in range(M+1):
    for i in range(d1+1):
        if d1 == i and i>1:
            for j in range(d2+1):
                if  m ==  i * j and m>0 and j>1:
                    count=count+1
        elif i>1:
            for j in range(10):
                if m == i*j and m>0 and j>1:
                    count=count+1
 
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getIntList(): return [int(x) for x in input().split()]

A = getIntList()

M = A[0]
d10 = int(A[1]/10)
d1 = int(A[1]-d10*10)
count = 0

for i in range(M):
  for j in range(A[1]):
    if(M>3):
      if(A[1]>21):
        d10 = int((j+1)/10)
        d1 = int((j+1)-d10*10)
        if(d1>1):
          if(d10>1):
            if(d1*d10 == (i+1)):
              count += 1

print(count)

Submission status: Accepted

Solution code:
m,d = map(int,input().split())
if len(str(d)) == 2:
	d1,d2 = str(d)[0],str(d)[1]

cnt = 0
m_list = [i+1 for i in range(m)]

if len(str(d)) == 2:
  for i in range(d+1):
    
    if i >= 20:
      d1,d2 = str(i)[0],str(i)[1]
      if d1=='1' or d2=='1':
        continue
      if int(d1)*int(d2) in m_list:
        cnt += 1
print(cnt)

Submission status: Accepted

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

cnt = 0
for i in range(d+1):
    do = i % 10
    dt = i // 10
    if do <= 1 or dt <= 1:
        continue
    if do*dt <= m:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
# v =list(map(int,input().split()))
# [list(map(int,input().split())) for i in range(N)]
d10 = D//10
d1 = D%10

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

Submission status: Accepted

Solution code:
import sys
m,d = map(int,input().split())
if d<21:
    print(0)
    sys.exit()
cnt=0
for i in range(1,m+1):
    for j in range(22,d+1):
        d10,d1=divmod(j, 10)
        if d1>=2 and i==d1*d10:
            cnt = cnt+1
print(cnt)

Submission status: Accepted

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

Futaketa_max = D//10
Hitoketa_max_max = D % 10

counter = 0
for t in range(M):
  m = t+1
  for i in range(Futaketa_max):
    if m % (i+1) ==0 and m / (i+1) >=2:
      d2 = m / (i+1)
      if d2 < 10:
        if m/d2 >=2:
          if i+1 == Futaketa_max:
            if d2 <= Hitoketa_max_max:
              #print(m, i+1,d2,'1')
              counter += 1
          else:
            #print(m, i+1,d2,'2')
            counter += 1
print(counter)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
count=0
for m in range(1,M+1):
    for d in range(1,D+1):
        if d > 9 and d < 100:
            d1 = d%10
            if d1 >= 2:
                d10 = int(d/10)%10
                if d10 >= 2:
                    if m == d1*d10:
                        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(1, d+1):
    d_1 = j % 10
    if d_1 >= 2:
      d_10 = int(j/10)
      if d_10 >= 2:
        if i == d_1 * d_10 :
          count += 1
print(count)

Submission status: Accepted

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

for i in range(1, M + 1):
	for j in range(1, D + 1):
		j = str(j).zfill(len(str(D)))

		if int(j[0]) >= 2 and int(j[1]) >=2:

			if int(j[0]) * int(j[1]) == i:
				#print(i,j)
				cnt += 1

print(cnt)

Submission status: Accepted

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

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