結果

問題 No.605 板挟みの球面
ユーザー 👑 obakyanobakyan
提出日時 2019-05-04 18:09:43
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 266 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-05 07:57:43
合計ジャッジ時間 981 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
4,376 KB
testcase_01 AC 19 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 79 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local a, b = io.read("*n", "*n")
local sum = 0
local eps = 1.0e-7
local pi2 = math.pi * 2
local msq = math.sqrt
for x = a, b, eps do
  local y = msq(1 - x * x)
  if(0 < y) then
    sum = sum + eps / y * pi2 * y
  end
end
print(string.format("%.8f", sum))
0