CF1194G.Another Meme Problem
省选/NOI-
通过率:0%
时间限制:4.00s
内存限制:512MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Let's call a fraction yx good if there exists at least one another fraction y′x′ such that yx=y′x′, 1≤x′,y′≤9, the digit denoting x′ is contained in the decimal representation of x, and the digit denoting y′ is contained in the decimal representation of y. For example, 1326 is a good fraction, because 1326=12.
You are given an integer number n. Please calculate the number of good fractions yx such that 1≤x≤n and 1≤y≤n. The answer may be really large, so print it modulo 998244353.
我们称一个分数 yx 是“好的”,如果存在至少另一个分数 y′x′,满足:yx=y′x′,且 1≤x′,y′≤9,同时表示 x′ 的数字出现在 x 的十进制表示中,表示 y′ 的数字出现在 y 的十进制表示中。例如,1326 是一个好分数,因为 1326=12。
给定一个整数 n,请计算满足 1≤x≤n 且 1≤y≤n 的好分数 yx 的个数。答案可能非常大,请对 998244353 取模后输出。
输入格式
The only line of the input contains one integer n (1≤n<10100).
输入仅有一行,包含一个整数 n(1≤n<10100)。
输出格式
Print the number of good fractions yx such that 1≤x≤n and 1≤y≤n. The answer may be really large, so print it modulo 998244353.
输出满足 1≤x≤n 且 1≤y≤n 的“好分数” yx 的个数。答案可能非常大,因此请对 998244353 取模后输出。
输入输出样例
输入#1
42
输出#1
150
输入#2
3141592653589793238462643383279
输出#2
459925407
输入解题思路,AI测评打分。不知道怎么写?