結果
| 問題 | No.1206 OR, OR, OR...... |
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2020-08-30 14:26:34 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 390 bytes |
| 記録 | |
| コンパイル時間 | 389 ms |
| コンパイル使用メモリ | 85,248 KB |
| 実行使用メモリ | 60,160 KB |
| 最終ジャッジ日時 | 2026-05-10 08:53:54 |
| 合計ジャッジ時間 | 1,435 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 |
ソースコード
t = int(input())
mod = 998244353
def power(a, n, mod):
bi=str(format(n,"b"))
res=1
for i in range(len(bi)):
res=(res*res) %mod
if bi[i]=="1":
res=(res*a) %mod
return res
for i in range(t):
n,k = map(int, input().split())
ans = power(power(2, n, mod), k, mod)-power(power(2, n-1, mod), k, mod)
ans *= n
ans %= mod
print(ans)
brthyyjp