結果
| 問題 |
No.1206 OR, OR, OR......
|
| コンテスト | |
| ユーザー |
Rho
|
| 提出日時 | 2020-07-28 22:37:18 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 604 bytes |
| コンパイル時間 | 1,337 ms |
| コンパイル使用メモリ | 165,904 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 21:03:02 |
| 合計ジャッジ時間 | 2,146 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define vi vector<int>
#define all(a) a.begin(),a.end()
typedef pair<int,int> P;
const long long mod=998244353;
const long long inf=1ll<<61;
int modpow(int a,int x){
int res=1;
while(x){
if(x&1)res=res*a%mod;
a=a*a%mod;
x>>=1;
}
return res;
}
int res(int n,int k){
int a=1-modpow(2,(mod-2)*k);
int b=modpow(2,n*k);
a+=mod;
return n*a%mod*b%mod;
}
signed main(){
int t;cin>>t;
rep(i,t){
int a,b;cin>>a>>b;cout<<res(a,b)<<endl;
}
}
Rho