結果

問題 No.347 微分と積分
ユーザー bluemeganebluemegane
提出日時 2020-09-04 09:12:51
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 578 bytes
コンパイル時間 896 ms
コンパイル使用メモリ 115,940 KB
実行使用メモリ 27,252 KB
最終ジャッジ日時 2024-11-25 01:42:49
合計ジャッジ時間 2,394 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
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 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