AtCoder Regular Contest 141
B
Increasing Prefix XOR
AtCoder
⌀ 1265
原题
← AC →
翻译中…

Problem Statement

翻译中…

You are given positive integers $N$ and $M$.

翻译中…

Find the number of sequences $A=(A_1,\ A_2,\ \dots,\ A_N)$ of $N$ positive integers that satisfy the following conditions, modulo $998244353$.

翻译中…
  • $1 \leq A_1 < A_2 < \dots < A_N \leq M$.
  • $B_1 < B_2 < \dots < B_N$, where $B_i = A_1 \oplus A_2 \oplus \dots \oplus A_i$.
翻译中…

Here, $\oplus$ denotes bitwise $\mathrm{XOR}$.

翻译中…

What is bitwise $\mathrm{XOR}$? The bitwise $\mathrm{XOR}$ of non-negative integers $A$ and $B$, $A \oplus B$, is defined as follows: When $A \oplus B$ is written in base two, the digit in the $2^k$'s place ($k \geq 0$) is $1$ if exactly one of $A$ and $B$ is $1$, and $0$ otherwise. For example, we have $3 \oplus 5 = 6$ (in base two: $011 \oplus 101 = 110$). Generally, the bitwise $\mathrm{XOR}$ of $k$ non-negative integers $p_1, p_2, p_3, \dots, p_k$ is defined as $(\dots ((p_1 \oplus p_2) \oplus p_3) \oplus \dots \oplus p_k)$. We can prove that this value does not depend on the order of $p_1, p_2, p_3, \dots, p_k$.

翻译中…

Constraints

翻译中…
  • $1 \leq N \leq M < 2^{60}$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N M

翻译中…

Output

翻译中…

Print the answer.

翻译中…

样例

Input #1
2 4
Output #1
5
For example, $(A_1,\ A_2)=(1,\ 3)$ counts, since $A_1 < A_2$ and $B_1 < B_2$ where $B_1=A_1=1,\ B_2=A_1\oplus A_2=2$. The other pairs that count are $(A_1,\ A_2)=(1,\ 2),\ (1,\ 4),\ (2,\ 4),\ (3,\ 4)$.
Input #2
4 4
Output #2
0
Input #3
10 123456789
Output #3
205695670
题目信息
题号
arc141_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。