CF1103E.Radix sum
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Let's define radix sum of number a consisting of digits a1,…,ak and number b consisting of digits b1,…,bk (we add leading zeroes to the shorter number to match longer length) as number s(a,b) consisting of digits (a1+b1)mod10,…,(ak+bk)mod10 . The radix sum of several integers is defined as follows: s(t1,…,tn)=s(t1,s(t2,…,tn))
You are given an array x1,…,xn . The task is to compute for each integer i(0≤i<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 258 .
输入格式
The first line contains integer n — the length of the array( 1≤n≤100000 ).
The second line contains n integers x1,…xn — array elements( 0≤xi<100000 ).
输出格式
Output n integers y0,…,yn−1 — yi should be equal to corresponding number of ways modulo 258 .
输入输出样例
输入#1
2 5 6
输出#1
1 2
输入#2
4 5 7 5 7
输出#2
16 0 64 0
说明/提示
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 .