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

Submission status: Accepted

Solution code:
import sys, math, itertools, bisect, copy, re

from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
from pprint import pprint

# 10倍速いらしい
input = sys.stdin.readline

INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))

M, D = [int(x) for x in input().split()]

cnt = 0
for m in range(1, M + 1):
    for d in range(1, D + 1):
        if d > 10 and d // 10 >= 2 and d % 10 >= 2:
            if (d // 10) * (d % 10) == m:
                cnt += 1
                # print(f"{m}: {d}")

print(cnt)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

ans = 0
for i in range(M):
    for j in range(D):
        month = i + 1
        day = j + 1
        if day//10 == 1 or day%10 == 1:
            continue
        if(month == (day//10)*(day%10)):
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

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

print (ans)

Submission status: Accepted

Solution code:

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

cnt = 0
for m in range(1,M+1):
    for d in range(1,D+1):
        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:
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

    import copy


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

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

    count = 0

    for month in range(1,m+1):
        for day in range(22,d+1):
            str_day = str(day)
            d_1 = int(str_day[0])
            d_2 = int(str_day[1])
            if d_1 > 1 and d_2 > 1 and d_1 * d_2 == month:
                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 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:
            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 d in range(20, D+1):
            s = str(d)
            d1 = s[0]
            d0 = s[1]
            if int(d0) >=2 and int(d1) >=2 and m == int(d1) * int(d0):
                count += 1
    return count

if __name__ == '__main__':

    print(main())

Submission status: Accepted

Solution code:

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

D1 = D % 10
D10 = D // 10

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

print(ans)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

if(B<22):
    print("0")
else:
    answer=0
    for i in range(22,B+1):
        if(i%10 != 1 and i%10 != 0):
            if((i//10) * (i%10) <= A):
                answer+=1
    print(answer)

Submission status: Accepted

Solution code:
M,D=map(int,input().split())
ans=0
for m in range(1,M+1):
    for d in range(1,D+1):
        d10,d1=[int(c) for c in str(d).zfill(2)]
        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(1,m+1):
    for j in range(1,d+1):
        d10=int(("0"+str(j))[-2])
        d1=int(("0"+str(j))[-1])
        if d1>=2 and d10>=2 and d1*d10==i:
            cnt+=1
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if D<=21:
  print(0)
else:
  for i in range(1,M+1):
    for j in range(22,D+1):
      d01 = j//10
      d10 = j%10
      if d01>=2 and d10>=2 and i==d01*d10:
        a+=1
  print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
M,D=map(int,input().split())
if D<=19:
    print(0)
else:
    count=0
    for m in range(1,M+1):
        for d in range(20,D+1):
            d1=d%10
            d10=d//10
            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())
cnt = 0
for i in range(1, M+1):
    for j in range(10, D+1):
        d10 = int(j /10)
        d1 = j % 10
        if i == (d10*d1) and d10 >= 2 and d1 >= 2:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

sn = lambda : stdin.readline().rstrip()
an = lambda : map(int, stdin.readline().split())
ni = lambda : int(sn())
def main():
  m, d = an()

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

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
m, d = map(int, input().split())
ans = 0
for i in range(1, m + 1):
    for j in range(10, d + 1):
        if j // 10 < 2 or j % 10 < 2:
            continue
        if i == (j // 10) * (j % 10):
            ans += 1
print(ans)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

count = 0
for m in range(1, M + 1):
    for d in range(1, D + 1):
        if len(str(d)) == 1:
            continue
        d10, d1 = map(int, list(str(d)))
        if d10 >= 2 and d1 >= 2 and d1 * d10 == m:
            count += 1
print(count)

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools


def main():
    month, day = map(int, input().split())

    ans = 0
    for i in range(1, month + 1):
        for j in range(1, day + 1):
            aaa = j % 10
            bbb = j % 100
            if bbb < 10:
                continue
            bbb = str(bbb)[0]
            bbb = int(bbb)
            if aaa < 2 or bbb < 2:
                continue

            if aaa * bbb == i:
                ans += 1

    print(ans)






if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#第一回日本最強プログラマー学生選手権-予選- A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

m,d = LI()
cnt = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        k = str(j)
        if len(k) == 1:
            continue
        if int(k[0]) >= 2 and int(k[1]) >= 2:
            if int(k[0])*int(k[1]) == i:
                cnt += 1
print(cnt)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
M,D = map(int,input().split(' '))

cnt = 0
for i in range(1,M+1):
    for j in range(1,D+1):
        dd = j // 10
        d  = j % 10
        if dd>=2 and d>=2 and d*dd==i:
            cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
m,d=map(int,input().split())
ans=0
for i in range(m):
    for j in range(d):
        done=(j+1)%10
        dtwo=(j+1)//10
        if done>=2 and dtwo>=2 and done*dtwo==(i+1):
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
from itertools import permutations,groupby
import sys
import bisect
import string
alp=string.ascii_lowercase
sys.setrecursionlimit(10**6)
def SI():
    return input().split()
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
mo=10**9+7
#mo=998244353
#input=sys.stdin.readline

M,D=MI()

ans=0


for m in range(1,M+1):
    for d in range(22,D+1):
        d1=d%10
        d10=(d-d%10)//10
        if d1<=1:
            continue
        if m==d10*d1:
            ans+=1
        #print(m,d1,d10,d10*d1)
    
print(ans)

Submission status: Accepted

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


s = 0
for i in range(1, M+1):
    for j in range(22, D+1):
        if int(str(j)[0]) < 2 or int(str(j)[1]) < 2:
            continue
        d10 = str(j)[0]
        d1 = str(j)[1]
        if int(d10) * int(d1) == i:
            s += 1
print(s)

Submission status: Accepted

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

def is_mday(m,d1,d10):
    if d1 >= 2 and d10 >= 2 and m == d1 * d10:
        return True
    else:
        return False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  m,d=LI()
  ans=0

  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:
        continue
      if d10<2:
        continue

      if d1*d10==i:
        # print(i,j)
        ans+=1
  return ans

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
total = 0
for d in range(1, D + 1):
    for m in range(1, M + 1):
        if d >= 20:
            d1 = d // 10
        else:
            break
        if d % 10 < 2:
            break
        else:
            d2 = d % 10
        if d1 * d2 == m:
            total += 1
print(total)

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
c=0
for i in range(1,a+1):
    for j in range(2,b//10+1):
        if i%j==0:
            if 2<=i//j<10:
                if int(str(j)+str(i//j))<=b:
                    c+=1
print(c)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000000)
#input = sys.stdin.readline

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

solve()

Submission status: Accepted

Solution code:
def seki(D):
  d10 = D//10
  d1 = D%10
  if d1>1 and d10>1:
    return(d1*d10)
  else:
    return 0

M,D = map(int,input().split())
ans = 0
for i in range(1,D+1):
  if 1<=seki(i)<=M:
    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):
        if j//10 >= 2 and j%10 >= 2 and (j//10) * (j%10) == i:
            cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M,D = [int(s) for s in input().split()]
ls=[[a,b] for a in range(2,10) for b in range(2,10)]
count=0
for x in ls:
  if(x[0]*10+x[1]<=D and x[0]*x[1]<=M):
    count+=1
print(count)

Submission status: Accepted

Solution code:

a, b = map(int, input().split())
ans = 0
for i in range(1, a+1):
    for j in range(1, b+1):
        j1 = j // 10
        j2 = j % 10

        if(j1 * j2 == i and j1 >= 2 and j2 >= 2):
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spacesn

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

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):
        if day < 10:
            continue
        day_str = str(day)
        d10 = int(day_str[0])
        d1 = day % 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == month:
            count += 1
print(count)

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

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):
        #i月j日
        s=str(d)
        if len(s)==1:
            s="0"+s
        d1,d10=int(str(s)[0]),int(str(s)[1])
        if m==d1*d10 and d1>=2 and d10>=2:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
M,D = map(int,input().split())
ans = 0
for m in range(1,M+1) :
    for d in range(1,D+1) :
        if d < 10 :
            continue
        d1 = int(str(d)[0])
        d10 = int(str(d)[1])

        if d1 <= 1 or d10 <= 1 :
            continue
        
        if d1 * d10 == m :
            ans += 1
print(ans)

Submission status: Accepted

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

ret = 0
for i in range(1, M+1):
    for j in range(1, D+1):
        d10 = j // 10
        d1 = j % 10
        if i == d10 * d1 and d1 >= 2 and d10 >= 2:
            ret += 1

print(ret)

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

Submission status: Accepted

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

ans = 0

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

ans = 0
for m in range(1,M+1):
    for d in range(1,D+1):
        if d <10:
            continue
        sd = str(d)
        if int(sd[1]) >= 2 and int(sd[0]) >= 2:
            if int(sd[0])*int(sd[1]) == m:
                ans+=1
print(ans)

Submission status: Accepted

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

count=0
for i in range(M):
    for j in range(D):
        d_10=(j+1)//10
        d_1=(j+1)%10
        dd=d_1*d_10
        if dd==i+1 and d_1>=2 and d_10>=2 :
            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(1, D+1):
        d1 = j % 10
        d10 = j // 10
        if d1 >= 2 and d10 >= 2 and d1*d10 == i:
            cnt += 1
print(str(cnt))

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# n = int(input())
# a, 
# s = input()

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

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


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(M, D):
    ans = 0

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


def main():
    M, D = read_int_n()
    print(slv(M, D))


if __name__ == '__main__':
    main()

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 d1 == 1 or d2 == 1:
            continue

        if d1 * d2 == m:
            res += 1

print(res)

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    M, D = MAP()
    count = 0
    for mm in range(1, M+1):
        for dd in range(1, D+1):
            d1 = dd % 10
            d10 = dd // 10
            if d1 > 1 and d10 > 1:
                if d1 * d10 == mm:
                    count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
for m in range(1, M + 1):
    for d in range(1, D + 1):
        if len(str(d)) == 1:
            continue
        d10, d1 = int(str(d)[0]), int(str(d)[1])
        if (d10 == 1) or (d1 == 1):
            continue
        if d10 * d1 == m:
            ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

answer = 0
for d in range(10,D+1):
    a,b = divmod(d,10)
    if a >= 2 and b >= 2 and 1<=a*b<=M:
        answer += 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
M, D = [int(_) for _ in input().split()]
ans = 0
for d in range(10, D + 1):
    d = str(d)
    d0 = int(d[0])
    d1 = int(d[1])
    if d0 > 1 and d1 > 1 and d0 * d1 < M + 1:
        ans += 1
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
M, D = map(int, input().split())
ans = 0
for m in range(1, M + 1):
    for d in range(1, D + 1):
        if d >= 10:
            d10 = int(str(d)[0])
            d1 = int(str(d)[1])
            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())

res = 0
for month in range(1, m + 1):
    for day in range(1, d + 1):
        d10 = day // 10
        d1 = day % 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == month:
            res += 1

print(int(res))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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):
        d1=j%10
        d10=j//10
        if d1*d10==i and d1>=2 and d10>=2:
            #print(i,j)
            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(10,D+1):
        a,b=map(int,list(str(j)))
        if a>=2 and b>=2 and i==a*b:
            ans+=1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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