結果

問題 No.347 微分と積分
ユーザー HimatsubushinHimatsubushin
提出日時 2016-03-09 09:04:50
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 769 bytes
コンパイル時間 790 ms
コンパイル使用メモリ 109,484 KB
実行使用メモリ 27,480 KB
最終ジャッジ日時 2024-09-24 16:35:49
合計ジャッジ時間 2,259 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 18 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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.Log10(Math.Abs(a));
                else
                    inte += Math.Pow((double)b, a + 1.0) / (a + 1.0);
            }

            Console.WriteLine(diff);
            Console.WriteLine(inte);
        }
    }
}
0