#abc288h. Ex - A Nameless Counting Problem

Ex - A Nameless Counting Problem

Score : 600600 points

问题描述

输出满足以下两个条件的整数序列长度为 NN 的序列 A=(A1,A2,,AN)A = (A_1, A_2, \ldots, A_N) 的个数,结果对 998244353998244353 取模。

  • 0A1A2ANM0 \leq A_1 \leq A_2 \leq \cdots \leq A_N \leq M
  • A1A2AN=XA_1 \oplus A_2 \oplus \cdots \oplus A_N = X

此处,\oplus 表示按位异或运算。

什么是按位异或运算?

非负整数 AABB 的按位异或运算(记作 ABA \oplus B)定义如下:

  • ABA \oplus B 以二进制表示时,第 kk 位最低位(k0k \geq 0)在以下情况下为 11AABB 的第 kk 位最低位中恰好有一个是 11;否则为 00

例如,35=63 \oplus 5 = 6(二进制表示:011101=110011 \oplus 101 = 110)。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Print the number of integer sequences of length NN, A=(A1,A2,,AN)A = (A_1, A_2, \ldots, A_N), that satisfy both of the following conditions, modulo 998244353998244353.

  • 0A1A2ANM0 \leq A_1 \leq A_2 \leq \cdots \leq A_N \leq M
  • A1A2AN=XA_1 \oplus A_2 \oplus \cdots \oplus A_N = X

Here, \oplus denotes bitwise XOR.

What is bitwise XOR?

The bitwise XOR of non-negative integers AA and BB, ABA \oplus B, is defined as follows.

  • When ABA \oplus B is written in binary, the kk-th lowest bit (k0k \geq 0) is 11 if exactly one of the kk-th lowest bits of AA and BB is 11, and 00 otherwise.

For instance, 35=63 \oplus 5 = 6 (in binary: 011101=110011 \oplus 101 = 110).

Constraints

  • 1N2001 \leq N \leq 200
  • 0M<2300 \leq M \lt 2^{30}
  • 0X<2300 \leq X \lt 2^{30}
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN MM XX

Output

Print the answer.

Sample Input 1

3 3 2

Sample Output 1

5

Here are the five sequences of length NN that satisfy both conditions in the statement: $(0, 0, 2), (0, 1, 3), (1, 1, 2), (2, 2, 2), (2, 3, 3)$.

Sample Input 2

200 900606388 317329110

Sample Output 2

788002104

update @ 2024/3/10 12:03:19