#abc353d. D - Another Sigma Problem
D - Another Sigma Problem
Score: points
问题陈述
对于正整数 和 ,定义 如下:
- 将 和 的十进制表示视为字符串,并将它们按此顺序连接起来,得到一个字符串 。 的值是将 解释为十进制整数时的值。
例如, 且 。
给定一个长度为 的正整数序列 。求以下表达式的值对 取模:
$\displaystyle \sum_{i=1}^{N-1}\sum_{j=i+1}^N f(A_i,A_j)$。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
For positive integers and , define as follows:
- Interpret the decimal representations of and as strings and concatenate them in this order to obtain a string . The value of is the value of when interpreted as a decimal integer.
For example, and .
You are given a sequence of positive integers of length . Find the value of the following expression modulo :
$\displaystyle \sum_{i=1}^{N-1}\sum_{j=i+1}^N f(A_i,A_j)$.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
3 14 15
Sample Output 1
2044
Thus, the answer is .
Sample Input 2
5
1001 5 1000000 1000000000 100000
Sample Output 2
625549048
Be sure to calculate the value modulo .
相关
在下列比赛中: