結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー jp_stejp_ste
提出日時 2016-05-16 02:02:01
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 444 bytes
コンパイル時間 2,608 ms
コンパイル使用メモリ 72,352 KB
実行使用メモリ 56,812 KB
最終ジャッジ日時 2023-08-21 13:23:35
合計ジャッジ時間 8,494 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
56,116 KB
testcase_01 AC 138 ms
55,908 KB
testcase_02 AC 140 ms
56,160 KB
testcase_03 AC 136 ms
56,332 KB
testcase_04 AC 169 ms
56,812 KB
testcase_05 AC 146 ms
56,236 KB
testcase_06 AC 157 ms
55,924 KB
testcase_07 AC 161 ms
56,384 KB
testcase_08 AC 162 ms
56,528 KB
testcase_09 AC 185 ms
56,092 KB
testcase_10 AC 137 ms
56,556 KB
testcase_11 AC 150 ms
55,908 KB
testcase_12 AC 150 ms
56,436 KB
testcase_13 AC 136 ms
55,876 KB
testcase_14 AC 135 ms
55,892 KB
testcase_15 AC 159 ms
56,636 KB
testcase_16 AC 140 ms
56,368 KB
testcase_17 AC 136 ms
55,872 KB
testcase_18 AC 155 ms
56,188 KB
testcase_19 AC 145 ms
55,912 KB
testcase_20 AC 137 ms
56,188 KB
testcase_21 AC 135 ms
55,736 KB
testcase_22 AC 143 ms
56,056 KB
testcase_23 AC 158 ms
56,324 KB
testcase_24 AC 152 ms
55,960 KB
testcase_25 WA -
testcase_26 AC 136 ms
56,456 KB
testcase_27 AC 136 ms
56,116 KB
testcase_28 AC 136 ms
56,128 KB
testcase_29 AC 148 ms
55,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner scan = new Scanner(System.in)) {
            int n = Integer.parseInt(scan.next());
            BigDecimal sum = BigDecimal.ZERO;
            for(int i=0; i<n; i++) {
                sum = sum.add(scan.nextBigDecimal());
            }
            System.out.println(sum.setScale(10));
        }
    }
}
0