結果

問題 No.2123 Chalk Breaker
ユーザー 👑 obakyanobakyan
提出日時 2022-11-08 23:55:16
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 5,220 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 13:22:06
合計ジャッジ時間 836 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
4,380 KB
testcase_01 AC 41 ms
4,380 KB
testcase_02 AC 12 ms
4,376 KB
testcase_03 AC 5 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 31 ms
4,380 KB
testcase_06 AC 5 ms
4,376 KB
testcase_07 AC 8 ms
4,376 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local n = io.read("*n")
local t = {}
t[1] = 1
for i = 2, n do
  local c = 0
  for j = 0, i - 1 do
    local a, b = j, i - j - 1
    if 0 < a then c = c + t[a] end
    if 0 < b then c = c + t[b] end
  end
  t[i] = 1 + c / i
end
print(string.format("%.10f", t[n]))
0