結果

問題 No.1206 OR, OR, OR......
ユーザー 双六双六
提出日時 2020-08-31 23:18:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 826 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 71,828 KB
最終ジャッジ日時 2023-08-10 18:05:28
合計ジャッジ時間 1,784 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,664 KB
testcase_01 AC 86 ms
71,628 KB
testcase_02 AC 85 ms
71,620 KB
testcase_03 AC 84 ms
71,784 KB
testcase_04 AC 85 ms
71,780 KB
testcase_05 AC 87 ms
71,740 KB
testcase_06 AC 85 ms
71,328 KB
testcase_07 AC 84 ms
71,828 KB
testcase_08 AC 84 ms
71,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 998244353; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	T = int(input())
	for _ in range(T):
		N, K = getlist()
		ans = pow(2, N * K, con) - pow(2, (N - 1) * K, con)
		ans *= N
		ans %= con
		print(ans)



if __name__ == '__main__':
	main()
0