CF1336E2.Chiori and Doll Picking (hard version)

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

This is the hard version of the problem. The only difference between easy and hard versions is the constraint of mm . You can make hacks only if both versions are solved.

Chiori loves dolls and now she is going to decorate her bedroom!

As a doll collector, Chiori has got nn dolls. The ii -th doll has a non-negative integer value aia_i ( ai<2ma_i < 2^m , mm is given). Chiori wants to pick some (maybe zero) dolls for the decoration, so there are 2n2^n different picking ways.

Let xx be the bitwise-xor-sum of values of dolls Chiori picks (in case Chiori picks no dolls x=0x = 0 ). The value of this picking way is equal to the number of 11 -bits in the binary representation of xx . More formally, it is also equal to the number of indices 0i<m0 \leq i < m , such that x2i\left\lfloor \frac{x}{2^i} \right\rfloor is odd.

Tell her the number of picking ways with value ii for each integer ii from 00 to mm . Due to the answers can be very huge, print them by modulo 998244353998\,244\,353 .

输入格式

The first line contains two integers nn and mm ( 1n21051 \le n \le 2 \cdot 10^5 , 0m530 \le m \le 53 ) — the number of dolls and the maximum value of the picking way.

The second line contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n ( 0ai<2m0 \le a_i < 2^m ) — the values of dolls.

输出格式

Print m+1m+1 integers p0,p1,,pmp_0, p_1, \ldots, p_mpip_i is equal to the number of picking ways with value ii by modulo 998244353998\,244\,353 .

输入输出样例

  • 输入#1

    4 4
    3 5 8 14

    输出#1

    2 2 6 6 0
  • 输入#2

    6 7
    11 45 14 9 19 81

    输出#2

    1 2 11 20 15 10 5 0
首页