No.2489 X and Xor 2
問題文最終更新日: 2023-09-29 22:49:10
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
The expected solution contained an error, so a rejudge was performed. We apologize to those affected.
Problem Statement
Find the sum of the following value over all sequences $A=(A_1,A_2,\ldots,A_N)$ of length $N$ consisting of integers at least $0$ and less than $M$, modulo $998244353$.
- $(A_1 \oplus A_2) \times (A_2 \oplus A_3) \times \ldots \times (A_{N-1} \oplus A_N)$
Here, $a \oplus b$ denotes the $\mathrm{bit}$wise exclusive OR of $a$ and $b$.
Input
$N$ $M$
- $2 \le N \le 10^{18}$
- $1 \le M \le 10^{18}$
- All input values are integers.
Output
Output the answer.
Sample
Sample 1
Input
2 2
Output
2
Sample 2
Input
2 1
Output
0
Sample 3
Input
314 159
Output
314977317
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。