結果
問題 | No.347 微分と積分 |
ユーザー |
|
提出日時 | 2016-03-09 12:21:50 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 27 ms / 5,000 ms |
コード長 | 767 bytes |
コンパイル時間 | 1,834 ms |
コンパイル使用メモリ | 109,988 KB |
実行使用メモリ | 27,460 KB |
最終ジャッジ日時 | 2024-09-24 16:42:49 |
合計ジャッジ時間 | 2,245 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace No347 { class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); int b = int.Parse(Console.ReadLine()); string[] sa = Console.ReadLine().Split(' '); double diff = 0.0, inte = 0.0; double a; for (int i = 0; i < n; i++) { a = double.Parse(sa[i]); diff += a * Math.Pow((double)b, a - 1.0); if (a == -1.0) inte += Math.Abs(Math.Log(b)); else inte += Math.Pow((double)b, a + 1.0) / (a + 1.0); } Console.WriteLine(diff); Console.WriteLine(inte); } } }