시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 27 | 17 | 17 | 62.963% |
You are given an array of n integers, a1, a2, . . . , an. Each integer is between 0 and 2k − 1, inclusive.
Let’s say that f(x) is the smallest i, such that (ai&x) ≠ ai, or 0, if there are no such i. (a&b) is the bitwise AND operation.
Find f(0) + f(1) + . . . + f(2k − 1). As this value may be very large, find it modulo 998 244 353.
The first line contains two integers: n, k (1 ≤ n ≤ 100, 1 ≤ k ≤ 60).
The next line contains n integers: a1, a2, . . . , an (0 ≤ ai < 2k).
Print one integer: f(0) + f(1) + . . . + f(2k − 1), modulo 998 244 353.
2 1 0 1
2
2 2 2 1
4
5 10 389 144 883 761 556
1118
In the first example, f(0) = 2, f(1) = 0.
In the second example, f(0) = 1, f(1) = 1, f(2) = 2, f(3) = 0.
Camp > Petrozavodsk Programming Camp > Winter 2020 > Day 3: 300iq Petrozavodsk Contest III I번