結果

問題 No.347 微分と積分
ユーザー HimatsubushinHimatsubushin
提出日時 2016-03-09 09:04:50
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 769 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 108,688 KB
実行使用メモリ 25,424 KB
最終ジャッジ日時 2023-10-24 21:23:44
合計ジャッジ時間 2,238 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
25,368 KB
testcase_01 AC 26 ms
25,364 KB
testcase_02 AC 27 ms
25,368 KB
testcase_03 AC 27 ms
25,364 KB
testcase_04 AC 26 ms
25,300 KB
testcase_05 AC 26 ms
25,300 KB
testcase_06 WA -
testcase_07 AC 27 ms
25,364 KB
testcase_08 AC 27 ms
25,364 KB
testcase_09 AC 26 ms
25,364 KB
testcase_10 AC 26 ms
25,368 KB
testcase_11 AC 26 ms
25,364 KB
testcase_12 AC 26 ms
25,300 KB
testcase_13 AC 27 ms
25,368 KB
testcase_14 WA -
testcase_15 AC 27 ms
25,364 KB
testcase_16 AC 26 ms
25,364 KB
testcase_17 AC 26 ms
25,368 KB
testcase_18 AC 26 ms
25,364 KB
testcase_19 AC 26 ms
25,300 KB
testcase_20 AC 26 ms
25,344 KB
testcase_21 AC 26 ms
25,372 KB
testcase_22 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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