結果

問題 No.129 お年玉(2)
ユーザー 👑 obakyanobakyan
提出日時 2020-04-11 23:09:17
言語 Lua
(LuaJit 2.1.1696795921)
結果
MLE  
実行時間 -
コード長 346 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 5,152 KB
実行使用メモリ 612,776 KB
最終ジャッジ日時 2023-10-19 19:53:45
合計ジャッジ時間 20,553 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
31,280 KB
testcase_01 MLE -
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 352 ms
250,944 KB
testcase_06 AC 528 ms
364,572 KB
testcase_07 AC 680 ms
470,856 KB
testcase_08 AC 454 ms
316,908 KB
testcase_09 AC 612 ms
422,544 KB
testcase_10 AC 703 ms
492,240 KB
testcase_11 AC 437 ms
306,364 KB
testcase_12 AC 552 ms
380,568 KB
testcase_13 AC 591 ms
405,876 KB
testcase_14 AC 559 ms
386,340 KB
testcase_15 AC 470 ms
327,308 KB
testcase_16 AC 525 ms
361,716 KB
testcase_17 AC 670 ms
459,240 KB
testcase_18 AC 610 ms
424,620 KB
testcase_19 AC 665 ms
462,408 KB
testcase_20 AC 663 ms
457,884 KB
testcase_21 MLE -
testcase_22 AC 462 ms
319,692 KB
testcase_23 AC 724 ms
510,948 KB
testcase_24 AC 697 ms
486,168 KB
testcase_25 AC 440 ms
307,860 KB
testcase_26 AC 449 ms
313,980 KB
testcase_27 AC 439 ms
306,228 KB
testcase_28 MLE -
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 7 ms
6,212 KB
testcase_34 AC 3 ms
4,348 KB
testcase_35 AC 7 ms
5,724 KB
testcase_36 AC 8 ms
6,256 KB
testcase_37 AC 9 ms
7,280 KB
testcase_38 AC 95 ms
65,848 KB
testcase_39 AC 128 ms
92,748 KB
testcase_40 AC 406 ms
289,636 KB
testcase_41 AC 256 ms
183,964 KB
testcase_42 AC 101 ms
73,380 KB
testcase_43 AC 100 ms
72,312 KB
testcase_44 MLE -
testcase_45 AC 59 ms
42,180 KB
testcase_46 AC 150 ms
108,296 KB
testcase_47 MLE -
testcase_48 AC 473 ms
330,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n = io.read()
if #n <= 3 then
  n = 0
else
  n = n:sub(1, #n - 3)
  n = tonumber(n)
end
local m = io.read("*n")
local mod = 1000000000
n = n % m
local t = {{1}}
for i = 1, m do
  t[i + 1] = {}
  t[i + 1][1] = 1
  for j = 1, i - 1 do
    t[i + 1][j + 1] = (t[i][j] + t[i][j + 1]) % mod
  end
  t[i + 1][i + 1] = 1
end
print(t[m + 1][n + 1])
0