結果

問題 No.347 微分と積分
ユーザー bluemeganebluemegane
提出日時 2020-09-04 09:12:51
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 578 bytes
コンパイル時間 1,460 ms
コンパイル使用メモリ 63,200 KB
実行使用メモリ 25,296 KB
最終ジャッジ日時 2023-08-16 12:49:23
合計ジャッジ時間 5,086 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
23,212 KB
testcase_01 AC 68 ms
23,264 KB
testcase_02 AC 69 ms
23,252 KB
testcase_03 AC 69 ms
23,256 KB
testcase_04 AC 68 ms
23,120 KB
testcase_05 AC 67 ms
23,036 KB
testcase_06 WA -
testcase_07 AC 69 ms
23,112 KB
testcase_08 AC 68 ms
23,280 KB
testcase_09 AC 68 ms
23,204 KB
testcase_10 AC 69 ms
23,188 KB
testcase_11 AC 68 ms
23,068 KB
testcase_12 AC 66 ms
20,964 KB
testcase_13 AC 68 ms
23,260 KB
testcase_14 WA -
testcase_15 AC 70 ms
25,296 KB
testcase_16 AC 70 ms
23,172 KB
testcase_17 AC 69 ms
23,216 KB
testcase_18 AC 69 ms
23,244 KB
testcase_19 AC 67 ms
23,136 KB
testcase_20 AC 67 ms
23,248 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

using static System.Math;
using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        var b = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, double.Parse);
        var ans1 = 0d;
        var ans2 = 0d;
        for (int i = 0; i < n; i++)
        {
            ans1 += a[i] * Pow(b, a[i] - 1);
            ans2 += (1 / (a[i] + 1) * Pow(b, a[i] + 1));
        }
        Console.WriteLine("{0}\n{1}", ans1, ans2);
    }
}
0