結果

問題 No.1206 OR, OR, OR......
ユーザー ooaiu
提出日時 2025-07-12 05:26:04
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 3,059 ms
コンパイル使用メモリ 276,404 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-07-12 05:26:09
合計ジャッジ時間 3,761 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using mint = atcoder::modint998244353;
int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int tt;
	cin >> tt;
	while(tt--) {
		int n, k;
		cin >> n >> k;
		mint ans = mint::raw(2).pow((long)n * k) - mint::raw(2).pow((long)(n-1)*k);
		ans *= n;
		cout<<ans.val()<<"\n";
	}
}
0