結果

問題 No.3072 Sum of sqrt(x)
ユーザー Lisp_CoderLisp_Coder
提出日時 2023-05-26 00:02:17
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 389 ms
コンパイル使用メモリ 4,940 KB
実行使用メモリ 49,540 KB
最終ジャッジ日時 2023-08-26 00:55:26
合計ジャッジ時間 16,993 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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("%20f", results[i]))
end
0