問題一覧 > 通常問題

No.1206 OR, OR, OR......

レベル : / AI推定難易度 : 1000 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 171
作問者 : Rho / テスター : kaage
お気に入りにしたユーザー ProblemId : 4842 / 自分の提出
問題文最終更新日: 2020-08-29 23:48:10
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
技術室奥プログラミングコンテスト#5 Day2 (順位表) の他の問題:

Problem Statement

Define the set $I$ as the set containing each integer between $0$ and $N-1$, inclusive, exactly once.
Also, take arbitrary subsets $J_1 , J_2 , ... J_K $ of $I$.

Here, the beauty of the tuple of $K$ subsets $J_1 , J_2 , ... J_K $ is defined as the number of elements in their union. (For the precise definition of union, see here.)
Calculate the sum of the beauty over all ways to choose $J_1, J_2, ... J_K$.
Since the answer can be very large, find it modulo $998 244 353$.

$T$ test cases are given; answer each of them.

Input

$T$
$N_1\ K_1$
...
$N_T\ K_T$

All inputs are integers.
$1 \leq T \leq 100$
$1 \leq N \leq 10^9$
$1 \leq K \leq 10^9$

Output

Output $T$ lines. On the $i$-th line, output the $i$-th answer modulo $998 244 353$.
Print a newline at the end.

Sample

Sample 1
Input
3
1 2
3 7
172894913 183245832
Output
3
6242304
358532619

The following is an explanation of the test case on line 2.
The set is $I=\{0\}$. The possible tuples $(J_1, J_2)$ are the following 4: $(\{\},\{\}), (\{\},\{0\}), (\{0\},\{\}), (\{0\},\{0\})$.
Their beauties are, from left to right, $0, 1, 1, 1$, so output their sum, $3$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。