問題一覧 > 通常問題

No.1952 xooooooooooor

レベル : / AI推定難易度 : 1400 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 76
作問者 : H20 / テスター : 蜜蜂 MtSaka
お気に入りにしたユーザー ProblemId : 7946 / 自分の提出
問題文最終更新日: 2022-04-12 22:01:08
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もしくは右上の雲マークをクリックしてアカウントを作成してください。