AtCoder Regular Contest 144
D
AND OR Equation
AtCoder
⌀ 2468
原题
← CE →
翻译中…

Problem Statement

翻译中…

You are given positive integers $N$ and $K$. Find the number, modulo $998244353$, of integer sequences $\bigl(f(0), f(1), \ldots, f(2^N-1)\bigr)$ that satisfy all of the following conditions:

翻译中…
  • $0\leq f(x)\leq K$ for all non-negative integers $x$ ($0\leq x \leq 2^N-1$).
  • $f(x) + f(y) = f(x \,\mathrm{AND}\, y) + f(x \,\mathrm{OR}\, y)$ for all non-negative integers $x$ and $y$ ($0\leq x, y \leq 2^N-1$)
翻译中…

Here, $\mathrm{AND}$ and $\mathrm{OR}$ denote the bitwise AND and OR, respectively.

翻译中…

Constraints

翻译中…
  • $1\leq N\leq 3\times 10^5$
  • $1\leq K\leq 10^{18}$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N K

翻译中…

Output

翻译中…

Print the number, modulo $998244353$, of integer sequences that satisfy the conditions.

翻译中…

样例

Input #1
2 1
Output #1
6
The following six integer sequences satisfy the conditions: - $(0,0,0,0)$ - $(0,1,0,1)$ - $(0,0,1,1)$ - $(1,0,1,0)$ - $(1,1,0,0)$ - $(1,1,1,1)$
Input #2
2 2
Output #2
19
Input #3
100 123456789123456789
Output #3
34663745
题目信息
题号
arc144_d
时间限制
2 s
内存限制
1024 MB

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