QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 256 MB 總分: 100 可 Hack ✓
统计

一个整数序列 $a_1, a_2, \dots, a_n$ 被称为零序列,当且仅当它满足以下条件:

  • 对于 $i = 1, 2, \dots, n - 1$,$a_i \neq a_{i+1}$。
  • $a_1, a_2, \dots, a_n$ 的二进制异或和为 $0$,即: $$\bigoplus_{i=1}^n a_i = 0$$

给定 $n$ 和 $m$,求长度为 $n$ 且每个元素都选自集合 $\{0, 1, 2, \dots, 2^m - 1\}$ 的零序列的数量。

输入格式

第一行包含一个正整数 $T$ ($1 \le T \le 10^4$),表示测试用例的数量。

对于每个测试用例,一行包含两个整数 $n, m$ ($1 \le n \le 10^9, 0 \le m \le 10^9$),分别表示序列的长度和序列元素的二进制长度。

输出格式

对于每个测试用例,输出一个整数,表示答案模 $998244353$ 的结果。

样例

输入样例 1

5
1 3
2 3
3 3
4 3
5 3

输出样例 1

1
0
49
392
2401

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.