201462: [AtCoder]ARC146 C - Even XOR

Memory Limit:1024 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $600$ points

Problem Statement

How many sets $S$ consisting of non-negative integers between $0$ and $2^N-1$ (inclusive) satisfy the following condition? Print the count modulo $998244353$.

  • Every non-empty subset $T$ of $S$ satisfies at least one of the following:
    • The number of elements in $T$ is odd.
    • The $\mathrm{XOR}$ of the elements in $T$ is not zero.
What is $\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 the digits in that place 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 \le N \le 2 \times 10^5$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

$N$

Output

Print the answer.


Sample Input 1

2

Sample Output 1

15

Sets such as $\lbrace 0,2,3 \rbrace$, $\lbrace 1 \rbrace$, and $\lbrace \rbrace$ satisfy the condition.

On the other hand, $\lbrace 0,1,2,3 \rbrace$ does not.

This is because the subset $\lbrace 0,1,2,3 \rbrace$ of $\lbrace 0,1,2,3 \rbrace$ has an even number of elements, whose bitwise $\mathrm{XOR}$ is $0$.


Sample Input 2

146

Sample Output 2

743874490

Input

题意翻译

## 题面 请输出满足下述条件的集合 $S \in \{0,1,2,\ldots,2^N-1\}$ 的个数对 $998244353$ 取模后的结果。 - 对于所有 $S$ 的非空子集 $T$,均满足下列条件之一: - $\lvert T \rvert$ 为奇数; - $T$中所有元素的异或和不为 $0$。 [何为异或?](https://oi-wiki.org/math/bit/#%E4%B8%8E%E6%88%96%E5%BC%82%E6%88%96) ## 输入 一行一个整数 $N$。 ## 输出 一行一个整数,表示答案对 $998244353$ 取模后的结果。 ## 数据范围&限制 $1 \le N \le 2 \times 10^5$,保证输入数据全为整数。

加入题单

算法标签: