CF1103E.Radix sum

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Let's define radix sum of number aa consisting of digits a1,,aka_1, \ldots ,a_k and number bb consisting of digits b1,,bkb_1, \ldots ,b_k (we add leading zeroes to the shorter number to match longer length) as number s(a,b)s(a,b) consisting of digits (a1+b1)mod10,,(ak+bk)mod10(a_1+b_1)\mod 10, \ldots ,(a_k+b_k)\mod 10 . The radix sum of several integers is defined as follows: s(t1,,tn)=s(t1,s(t2,,tn))s(t_1, \ldots ,t_n)=s(t_1,s(t_2, \ldots ,t_n))

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

输入格式

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

The second line contains nn integers x1,xnx_1, \ldots x_n — array elements( 0xi<1000000 \leq x_i < 100000 ).

输出格式

Output nn integers y0,,yn1y_0, \ldots, y_{n-1}yiy_i should be equal to corresponding number of ways modulo 2582^{58} .

输入输出样例

  • 输入#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)(5,5) with radix sum 00 , sequence (5,6)(5,6) with radix sum 11 , sequence (6,5)(6,5) with radix sum 11 , sequence (6,6)(6,6) with radix sum 22 .

首页