Codeforces Round 534 (Div. 1)
E
Radix sum
Codeforces
3400
原题
← D→
翻译中…

Let's define radix sum of number $a$ consisting of digits $a_1, \ldots ,a_k$ and number $b$ consisting of digits $b_1, \ldots ,b_k$(we add leading zeroes to the shorter number to match longer length) as number $s(a,b)$ consisting of digits $(a_1+b_1)\mod 10, \ldots ,(a_k+b_k)\mod 10$. The radix sum of several integers is defined as follows: $s(t_1, \ldots ,t_n)=s(t_1,s(t_2, \ldots ,t_n))$

翻译中…

You are given an array $x_1, \ldots ,x_n$. The task is to compute for each integer $i (0 \le i \lt n)$ number of ways to consequently choose one of the integers from the array $n$ times, so that the radix sum of these integers is equal to $i$. Calculate these values modulo $2^{58}$.

翻译中…

Input

翻译中…

The first line contains integer $n$ — the length of the array($1 \leq n \leq 100000$).

翻译中…

The second line contains $n$ integers $x_1, \ldots x_n$ — array elements($0 \leq x_i \lt 100000$).

翻译中…

Output

翻译中…

Output $n$ integers $y_0, \ldots, y_{n-1}$ — $y_i$ should be equal to corresponding number of ways modulo $2^{58}$.

翻译中…

Note

翻译中…

In the first example there exist sequences: sequence $(5,5)$ with radix sum $0$, sequence $(5,6)$ with radix sum $1$, sequence $(6,5)$ with radix sum $1$, sequence $(6,6)$ with radix sum $2$.

翻译中…

样例

Input #1
2
5 6
Output #1
1
2
InputCopy OutputCopy
Input #2
4
5 7 5 7
Output #2
16
0
64
0
InputCopy OutputCopy
题目信息
题号
1103E
时间限制
4 s
内存限制
256 MB
标签
FFT
数学
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。