結果

問題 No.347 微分と積分
ユーザー mizunomi32mizunomi32
提出日時 2016-02-29 21:53:59
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 4,970 ms
コンパイル使用メモリ 74,636 KB
実行使用メモリ 57,996 KB
最終ジャッジ日時 2023-10-24 19:14:23
合計ジャッジ時間 8,925 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
57,376 KB
testcase_01 AC 134 ms
57,660 KB
testcase_02 AC 132 ms
57,560 KB
testcase_03 AC 133 ms
57,592 KB
testcase_04 AC 132 ms
57,556 KB
testcase_05 AC 133 ms
57,600 KB
testcase_06 WA -
testcase_07 AC 141 ms
57,556 KB
testcase_08 AC 134 ms
57,300 KB
testcase_09 AC 143 ms
55,696 KB
testcase_10 AC 131 ms
57,504 KB
testcase_11 AC 132 ms
57,864 KB
testcase_12 AC 134 ms
57,692 KB
testcase_13 AC 130 ms
57,436 KB
testcase_14 WA -
testcase_15 AC 119 ms
56,284 KB
testcase_16 AC 118 ms
56,296 KB
testcase_17 AC 133 ms
55,716 KB
testcase_18 AC 140 ms
57,596 KB
testcase_19 AC 138 ms
57,404 KB
testcase_20 AC 116 ms
56,596 KB
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class main {
    public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        int n = sc.nextInt();
        int b = sc.nextInt();
        double a;
        double j,k;
        double x1=0,x2=0;
        for (int i=0; i<n;i++){
            a = sc.nextDouble();
            j=a-1.0;
            k=a+1.0;
            x1 += a* Math.pow(b,j);
            x2 += 1/k*Math.pow(b,k);
        }
        System.out.println(x1);
        System.out.println(x2);
    }
}
0