結果

問題 No.2275 →↑↓
ユーザー 👑 obakyanobakyan
提出日時 2023-04-21 21:47:57
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 559 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 5,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 07:56:48
合計ジャッジ時間 1,625 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 47 ms
5,376 KB
testcase_07 AC 35 ms
5,376 KB
testcase_08 AC 57 ms
5,376 KB
testcase_09 AC 58 ms
5,376 KB
testcase_10 AC 57 ms
5,376 KB
testcase_11 AC 58 ms
5,376 KB
testcase_12 AC 57 ms
5,376 KB
testcase_13 AC 58 ms
5,376 KB
testcase_14 AC 57 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local mmi, mma = math.min, math.max
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 n = io.read("*n")
local a = {}
for i = 1, n do
  a[i] = io.read("*n")
end
local ret = 1
for i = 2, n do
  ret = bmul(ret, mmi(a[i - 1], a[i]))
end
print(ret)
0