結果
| 問題 |
No.347 微分と積分
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2019-03-28 19:31:19 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 329 bytes |
| コンパイル時間 | 31 ms |
| コンパイル使用メモリ | 6,692 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-13 10:13:54 |
| 合計ジャッジ時間 | 988 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
n, b = io.read("*n", "*n")
dif, int = 0, 0
for i = 1, n do
a = io.read("*n")
dif = dif + a * math.pow(b, a - 1)
if(string.format("%.1f", a) == "-1.0") then
int = int + math.log(math.abs(b))
else
int = int + math.pow(b, a + 1) / (a + 1)
end
end
io.write(string.format("%.8f\n%.8f\n", dif, int))