結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 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] = c / i
end
print(string.format("%.10f", t[n]))
0