CF1408I.Bitwise Magic
NOI/NOI+/CTSC
通过率:0%
时间限制:6.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given a positive integer k and an array a1,a2,…,an of non-negative distinct integers not smaller than k and not greater than 2c−1.
In each of the next k seconds, one element is chosen randomly equiprobably out of all n elements and decreased by 1.
For each integer x, 0≤x≤2c−1, you need to find the probability that in the end the bitwise XOR of all elements of the array is equal to x.
Each of these values can be represented as an irreducible fraction qp, and you need to find the value of p⋅q−1 modulo 998244353.
给你一个正整数 k 和一个长度为 n 的数组 a1,a2,…,an,其中每个元素均为非负互异的整数,且满足 k≤ai≤2c−1。
接下来的 k 秒内,每一秒都会从这 n 个元素中等概率随机选择一个元素,并将其值减 1。
对于每个整数 x(0≤x≤2c−1),你需要计算:经过上述 k 次操作后,数组所有元素的按位异或(bitwise XOR)结果恰好等于 x 的概率。
每个概率均可表示为最简分数 qp,你需输出 p⋅q−1mod998244353。
输入格式
The first line of input contains three integers n,k,c (1≤n≤(2c−k), 1≤k≤16, 1≤c≤16).
The second line contains n distinct integers a1,a2,…,an (k≤ai≤2c−1).
输入的第一行包含三个整数 n,k,c(1≤n≤(2c−k),1≤k≤16,1≤c≤16)。
第二行包含 n 个互不相同的整数 a1,a2,…,an(k≤ai≤2c−1)。
输出格式
Print 2c integers: the probability that the bitwise XOR is equal to x in the end for x in 0,1,…,2c−1 modulo 998244353.
输出 2c 个整数:对于 x∈{0,1,…,2c−1},最终按位异或(XOR)结果等于 x 的概率,对 998244353 取模。
输入输出样例
输入#1
4 1 3 1 2 3 4
输出#1
0 0 0 748683265 0 499122177 0 748683265
输入解题思路,AI测评打分。不知道怎么写?