結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー jp_stejp_ste
提出日時 2021-01-31 21:05:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 2,305 ms
コンパイル使用メモリ 71,888 KB
実行使用メモリ 56,556 KB
最終ジャッジ日時 2023-09-11 22:21:43
合計ジャッジ時間 8,803 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
55,936 KB
testcase_01 AC 140 ms
55,936 KB
testcase_02 AC 144 ms
55,820 KB
testcase_03 AC 141 ms
56,152 KB
testcase_04 AC 169 ms
56,228 KB
testcase_05 AC 152 ms
55,792 KB
testcase_06 AC 163 ms
56,556 KB
testcase_07 AC 164 ms
56,004 KB
testcase_08 AC 167 ms
56,136 KB
testcase_09 AC 189 ms
56,240 KB
testcase_10 AC 141 ms
55,904 KB
testcase_11 AC 154 ms
56,152 KB
testcase_12 AC 154 ms
56,016 KB
testcase_13 AC 141 ms
55,852 KB
testcase_14 AC 142 ms
55,968 KB
testcase_15 AC 165 ms
56,016 KB
testcase_16 AC 141 ms
56,028 KB
testcase_17 AC 142 ms
56,264 KB
testcase_18 AC 159 ms
56,092 KB
testcase_19 AC 148 ms
56,400 KB
testcase_20 AC 138 ms
55,856 KB
testcase_21 AC 137 ms
53,964 KB
testcase_22 AC 145 ms
55,968 KB
testcase_23 AC 158 ms
56,356 KB
testcase_24 AC 150 ms
55,820 KB
testcase_25 WA -
testcase_26 AC 138 ms
56,208 KB
testcase_27 AC 138 ms
56,244 KB
testcase_28 AC 138 ms
56,008 KB
testcase_29 AC 151 ms
56,360 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