結果

問題 No.1964 sum = length
ユーザー 👑 obakyanobakyan
提出日時 2022-10-04 12:34:00
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 604 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-28 15:44:07
合計ジャッジ時間 3,432 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 4 ms
4,380 KB
testcase_14 AC 6 ms
4,376 KB
testcase_15 AC 8 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 44 ms
4,380 KB
testcase_23 AC 37 ms
4,376 KB
testcase_24 AC 17 ms
4,380 KB
testcase_25 AC 21 ms
4,504 KB
testcase_26 AC 44 ms
4,376 KB
testcase_27 AC 27 ms
4,380 KB
testcase_28 AC 20 ms
4,376 KB
testcase_29 AC 32 ms
4,376 KB
testcase_30 AC 22 ms
4,376 KB
testcase_31 AC 44 ms
4,380 KB
testcase_32 AC 10 ms
4,376 KB
testcase_33 AC 9 ms
4,376 KB
testcase_34 AC 37 ms
4,380 KB
testcase_35 AC 13 ms
4,376 KB
testcase_36 AC 24 ms
4,376 KB
testcase_37 AC 31 ms
4,376 KB
testcase_38 AC 48 ms
4,376 KB
testcase_39 AC 21 ms
4,376 KB
testcase_40 AC 22 ms
4,376 KB
testcase_41 AC 41 ms
4,376 KB
testcase_42 AC 51 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local mod = 998244353
local function badd(x, y) return (x + y) % mod end
local n = io.read("*n")
local lim = 210
local t = {}
for i = 0, n - 1 do
  t[i] = 0
end
t[0] = 1
for irep = 1, n do
  for j = n - 1, 0, -1 do
    for k = 2, 9 do
      if j + k - 1 <= n - 1 then
        t[j + k - 1] = badd(t[j + k - 1], t[j])
      end
    end
    for k = 10, 99 do
      if j + k - 2 <= n - 1 then
        t[j + k - 2] = badd(t[j + k - 2], t[j])
      end
    end
    for k = 100, lim do
      if j + k - 3 <= n - 1 then
        t[j + k - 3] = badd(t[j + k - 3], t[j])
      end
    end
  end
end
print(t[n - 1])
0