CF1103E.Radix sum
NOI/NOI+/CTSC
通过率:0%
时间限制:4.00s
内存限制:256MB
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.
我们定义数字 a(其各位数字为 a1,…,ak)与数字 b(其各位数字为 b1,…,bk)的进位制和(radix sum)为一个数字 s(a,b),其各位数字为 (a1+b1)mod10,…,(ak+bk)mod10(若两数位数不同,则在较短数字前补前导零,使其长度与较长者一致)。
多个整数的进位制和定义如下:s(t1,…,tn)=s(t1,s(t2,…,tn))。
给定一个数组 x1,…,xn。任务是:对每个整数 i(其中 0≤i<n),计算从该数组中依次选取 n 个整数(每次均可任选其中一个,允许重复) 的方案数,使得这些被选出的整数的进位制和恰好等于 i。请将所有结果对 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).
第一行包含一个整数 n —— 数组的长度(1≤n≤100000)。
第二行包含 n 个整数 x1,…,xn —— 数组元素(0≤xi<100000)。
输出格式
Output n integers y0,…,yn−1 — yi should be equal to corresponding number of ways modulo 258.
输出 n 个整数 y0,…,yn−1 — 其中 yi 应等于对应方案数对 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.
在第一个例子中,存在以下序列:序列 (5,5) 的基数和为 0,序列 (5,6) 的基数和为 1,序列 (6,5) 的基数和为 1,序列 (6,6) 的基数和为 2。
输入解题思路,AI测评打分。不知道怎么写?