No.1952 xooooooooooor
問題文最終更新日: 2022-04-12 22:01:08
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
yukicoder contest 344
(順位表)
の他の問題:
Problem Statement
Output $(N\times2^0) \oplus (N\times2^1) \oplus \ldots \oplus (N\times2^{M-2}) \oplus (N\times2^{M-1})$ modulo $998244353$.
Here, $a \oplus b$ denotes the bitwise exclusive OR (XOR) of $a$ and $b$.
Input
$N\ M$
Constraints
- $ 0 \le N \le 10^{9}$
- $ 1 \le M \le 10^{9}$
- All inputs are integers.
Output
Output the answer modulo $998244353$, followed by a newline.
Sample
Sample 1
Input
20 3
Output
108
We have $(20\times2^0) \oplus (20\times2^1) \oplus (20\times2^2) = 20 \oplus 40 \oplus 80 = 108$.
Sample 2
Input
10000 1
Output
10000
Sample 3
Input
314 1592
Output
33087781
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
H20
蜜蜂