#abc288f. F - Integer Division
F - Integer Division
Score : points
问题描述
你给定一个正整数 ,其在十进制表示中有 位数字。 的任意一位数字都不是 。
对于 的子集 ,定义 如下:
将 的十进制表示视为长度为 的字符串,并通过以下方式将其分解为 个子字符串:仅当 时,在第 个和第 个字符之间进行分割。
然后,将这 个子字符串视为它们各自的十进制表示的整数,并令 为这些 个整数的乘积。
的所有子集中,包括空集,都可能是集合 。求所有这些 上的 的和,对 取模的结果。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a positive integer with digits in decimal representation. None of the digits of is .
For a subset of , let be defined as follows.
See the decimal representation of as a string of length , and decompose it into strings by splitting it between the -th and -th characters if and only if .
Then, see these strings as integers in decimal representation, and let be the product of these integers.
There are subsets of , including the empty set, which can be . Find the sum of over all these , modulo .
Constraints
- has digits in decimal representation, none of which is .
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
234
Sample Output 1
418
For , we have .
For , we have .
For , we have .
For , we have .
Thus, you should print .
Sample Input 2
4
5915
Sample Output 2
17800
Sample Input 3
9
998244353
Sample Output 3
258280134
update @ 2024/3/10 12:02:47