結果

問題 No.3072 Sum of sqrt(x)
ユーザー Lisp_CoderLisp_Coder
提出日時 2023-05-25 23:59:52
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 5,148 KB
実行使用メモリ 49,480 KB
最終ジャッジ日時 2023-08-26 00:53:20
合計ジャッジ時間 22,740 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,016 KB
testcase_02 WA -
testcase_03 AC 3 ms
5,076 KB
testcase_04 AC 2 ms
5,012 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,944 KB
testcase_07 WA -
testcase_08 AC 564 ms
18,484 KB
testcase_09 AC 1,531 ms
49,064 KB
testcase_10 OLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

function calculateSum(N, numbers)
  local sum = 0
  local result = {}

  for i = 1, N do
    sum = sum + math.sqrt(numbers[i])
    result[i] = sum
  end

  return result
end

local N = tonumber(io.read())
local numbers = {}

for i = 1, N do
  numbers[i] = tonumber(io.read())
end

local results = calculateSum(N, numbers)

for i = 1, N do
  print(string.format("%16f", results[i]))
end
0