luogu#P5390. [Cnoi2019] 数学作业
[Cnoi2019] 数学作业
Background
Gensokyo, the Spring Festival, and lights in every home.
Teacher Kamishirasawa Keine would of course not miss such a good chance... and assigned homework.
Problem Description
Now Cirno has homework for days. The homework for each day can be represented by an ordered pair , where is the size of the set, and is a set of size . Now Cirno needs to compute the sum of the XOR values over all subsets of . The answer should be taken modulo .
Formally:
$$\text{ans}\equiv \sum_{S \subseteq V} \mathop{\bigoplus}\limits_{ s \in S } s \pmod {998\,244\,353}$$Input Format
The first line contains an integer .
The following lines each contain an ordered pair .
Output Format
Output lines, each containing one integer representing the answer.
1
3 1 2 3
12
Hint
- Subtask 1 (17 pts): .
- Subtask 2 (22 pts): .
- Subtask 3 (61 pts): .
For of the testdata, .
Translated by ChatGPT 5