結果
| 問題 | No.1206 OR, OR, OR...... | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-10-04 05:36:17 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 481 bytes | 
| コンパイル時間 | 1,910 ms | 
| コンパイル使用メモリ | 194,400 KB | 
| 最終ジャッジ日時 | 2025-01-15 02:19:02 | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 8 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
constexpr ll mod=998244353;
ll mod_pow(ll a,ll b){
	a%=mod;
	if(b==0)return 1;
	if(b==1)return a;
	ll res=mod_pow(a,b/2)%mod;
	res*=res; res%=mod;
	if(b%2)res*=a;
	return res%mod;
}
int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int q; cin >> q;
	while(q--){
		ll n,k; cin >> n >> k;
		cout << n*mod_pow(2,n*k-k)%mod*(mod_pow(2,k)-1+mod)%mod << "\n";
	}
}
            
            
            
        