結果
| 問題 | 
                            No.1184 Hà Nội
                             | 
                    
| コンテスト | |
| ユーザー | 
                            👑  | 
                    
| 提出日時 | 2020-09-19 20:07:18 | 
| 言語 | Lua  (LuaJit 2.1.1734355927)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 803 bytes | 
| コンパイル時間 | 372 ms | 
| コンパイル使用メモリ | 5,504 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-23 18:15:51 | 
| 合計ジャッジ時間 | 1,209 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 2 WA * 25 | 
ソースコード
local mod = 998244353
local mfl = math.floor
local function bmul(x, y)
  local x0, y0 = x % 31596, y % 31596
  local x1, y1 = mfl(x / 31596), mfl(y / 31596)
  return (x1 * y1 * 62863 + (x1 * y0 + x0 * y1) * 31596 + x0 * y0) % mod
end
local function badd(x, y)
  return (x + y) % mod
end
local function bsub(x, y)
  return x < y and x - y + mod or x - y
end
local function modpow(src, pow)
  local res = 1
  while 0LL < pow do
    if pow % 2LL == 1LL then
      res = bmul(res, src)
      pow = pow - 1LL
    end
    src = bmul(src, src)
    pow = pow / 2LL
  end
  return res
end
local ffi = require("ffi")
local C = ffi.C
ffi.cdef[[
long long atoll(const char*);
]]
s = io.read()
a, b = s:match("(%d+) (%d+)")
a = C.atoll(a)
b = C.atoll(b)
a = a + 1LL - b
z = modpow(2, a)
z = bsub(z, 1)
print(z)