結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー jp_stejp_ste
提出日時 2021-01-31 21:13:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 178 ms / 5,000 ms
コード長 460 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 73,460 KB
実行使用メモリ 56,852 KB
最終ジャッジ日時 2023-09-29 22:57:54
合計ジャッジ時間 7,511 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
56,272 KB
testcase_01 AC 132 ms
55,960 KB
testcase_02 AC 145 ms
56,128 KB
testcase_03 AC 142 ms
56,132 KB
testcase_04 AC 159 ms
56,212 KB
testcase_05 AC 144 ms
56,044 KB
testcase_06 AC 152 ms
56,356 KB
testcase_07 AC 153 ms
56,400 KB
testcase_08 AC 156 ms
56,728 KB
testcase_09 AC 178 ms
56,500 KB
testcase_10 AC 132 ms
56,332 KB
testcase_11 AC 143 ms
56,260 KB
testcase_12 AC 142 ms
56,228 KB
testcase_13 AC 134 ms
56,852 KB
testcase_14 AC 142 ms
55,996 KB
testcase_15 AC 152 ms
56,320 KB
testcase_16 AC 133 ms
56,108 KB
testcase_17 AC 131 ms
56,440 KB
testcase_18 AC 150 ms
56,256 KB
testcase_19 AC 140 ms
55,808 KB
testcase_20 AC 131 ms
55,844 KB
testcase_21 AC 135 ms
56,088 KB
testcase_22 AC 139 ms
56,752 KB
testcase_23 AC 154 ms
56,184 KB
testcase_24 AC 144 ms
56,160 KB
testcase_25 AC 134 ms
56,632 KB
testcase_26 AC 134 ms
55,780 KB
testcase_27 AC 134 ms
56,076 KB
testcase_28 AC 134 ms
56,224 KB
testcase_29 AC 143 ms
56,324 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).toPlainString());
        }
    }
}
0