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: Runtime Error

Solution code:
m,d = map(int,input().split())
d1,d2 = str(d)[0],str(d)[1]
cnt = 0
m_list = [i+1 for i in range(m)]
for i in range(d):
  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: Runtime Error

Solution code:
import sys

def process(data):
	count = 0

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

	if len(D) < 2:
		return 0


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


	return count 

def main(argv):
	data = []
	for i, v in enumerate(argv):
		data.append(v)
	print(process(data))

	

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

Submission status: Runtime Error

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

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

print(count)

Submission status: Runtime Error

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_1 = int(str(j).zfill(len(str(M)))[-1])
        d_10 = int(str(j).zfill(len(str(M)))[-2])
        if d_10 > 1 and d_1 >1 and d_10 * d_1 == i:
            count += 1

print(count)

Submission status: Runtime Error

Solution code:
import sys

def process(data):
	count = 0

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

	if len(D) < 2:
		return 0


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


	return count 

def main(argv):
	data = []
	for i, v in enumerate(argv):
		data.append(v)
	print(process(data))
	

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

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

d10 = (date+1) // 10
    d1 = (date+1) % 10

Submission status: Runtime Error

Solution code:
import sys

def process(data):
	count = 0

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

	if len(D) < 2:
		return 0


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


	return count 

def main(argv):
	data = []
	for i, v in enumerate(argv):
		data.append(v)
	#print(process(data))
	return process(data)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

def process(data):
	count = 0

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

	if len(D) < 2:
		return 0


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


	return count 

def main(argv):
	data = []
	for i, v in enumerate(argv):
		data.append(v)
	print(process(data))
	return process(data)

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

Submission status: Runtime Error

Solution code:
import sys
stdin = sys.stdin

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

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input_data = input().split(" ")
M = int(input_data[0])
D = input_data[1]
d1 = int(D[1])
d10 = int(D[0])
cnt = 0
for i in range(1,M + 1):
  for j in range(22, int(D) + 1):
    if i == int(str(j)[0]) * int(str(j)[1]) and int(str(j)[1]) != 0  and int(str(j)[1]) != 1:
      cnt += 1
    else:
      pass

print(cnt)

Submission status: Runtime Error

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

result = 0

if D < 22:
    print(0)
else:
    for m in range(1, M+1):
        for d in range(22, D+1):
            d1 = d%10
            d10 = d//10
            if d1 > 1 and d1*d10 == m:
                result += 1
	print(result)

Submission status: Runtime Error

Solution code:
import sys
stdin = sys.stdin

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

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

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

Submission status: Runtime Error

Solution code:
import sys
import os
f = open('input.txt', 'r')
sys.stdin = f

m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(20, d + 1):
        if i == int(str(j)[0]) * int(str(j)[1]):
            ans += 1
print(ans)

Submission status: Runtime Error

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: Runtime Error

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(1,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: Runtime Error

Solution code:
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"

using namespace std;
const long long MOD = (long long)1e9 + 7;

int m, d;

int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> m >> d;
	int cnt = 0;
	for (int i = 22; i <= d; i++) {
		if (i % 10 >= 2 && i / 10 >= 2) {
			for (int j = 4; j <= m; j++)
				if ((i % 10)*(i / 10) == j) cnt++;
		}
	}
	cout << cnt << E;
	//system("pause");
	return 0;
}

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
template<class T> inline bool chmax(T& a, T b) {if (a<b) {a=b; return true;} return false;}
template<class T> inline bool chmin(T& a, T b) {if (a>b) {a=b; return true;} return false;}

const ll MOD = 1000000007;
const ll HIGHINF = (ll)1e18;

ll m, d;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> m >> d;
  ll ans = 0;
  rep(i, 1, m+1) {
    rep(j, 22, d+1) {
      ll d1 = j/10;
      ll d2 = j%10;
      if (d1<2||d2<2) continue;
      if (i==d1*d2) ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
using System;
using System.Collections.Generic;
using System.Linq;
using static Input;

public class Prog
{
    public struct Pair { public int x, y; public Pair(int x, int y) { this.x = x; this.y = y; } }
    public static void Solve()
    {
        int M = NextInt(), D = NextInt();
        int ans = 0;
        for (int i = 1; i <= M; i++)
            for (int j = 22; j <= D; j++) {
                if (j % 10 <= 1) continue;
                int b = 1;
                foreach (char c in j.ToString()) b *= int.Parse(c.ToString());
                if (b == i) ans++;
            }
        Console.WriteLine(ans);
    }
    public static void Main()
    {
        var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }
}
public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int m, d;
    cin >> m >> d;
    int ans = 0;
    rep(i, 4, m + 1) rep(j, 22, d + 1) {
        int d1 = j % 10;
        int d10 = j / 10;
        if (d1 >= 2 && d10 >= 2 && d1 * d10 == i)
            ans++;
    }
    cout << ans << endl;
    return 0;
}

Submission status: Runtime Error

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

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