結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-02 16:59:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 448 bytes
コンパイル時間 2,083 ms
コンパイル使用メモリ 71,972 KB
実行使用メモリ 56,732 KB
最終ジャッジ日時 2023-09-29 22:34:59
合計ジャッジ時間 6,838 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,588 KB
testcase_01 AC 118 ms
55,972 KB
testcase_02 AC 120 ms
56,076 KB
testcase_03 AC 118 ms
55,960 KB
testcase_04 AC 125 ms
56,392 KB
testcase_05 AC 124 ms
56,056 KB
testcase_06 AC 126 ms
56,280 KB
testcase_07 AC 127 ms
56,440 KB
testcase_08 AC 127 ms
56,052 KB
testcase_09 AC 130 ms
56,248 KB
testcase_10 AC 117 ms
55,944 KB
testcase_11 AC 123 ms
56,192 KB
testcase_12 AC 123 ms
55,988 KB
testcase_13 AC 119 ms
56,420 KB
testcase_14 AC 118 ms
56,092 KB
testcase_15 AC 125 ms
56,300 KB
testcase_16 AC 117 ms
56,252 KB
testcase_17 AC 117 ms
56,332 KB
testcase_18 AC 125 ms
56,012 KB
testcase_19 AC 122 ms
56,576 KB
testcase_20 AC 121 ms
56,084 KB
testcase_21 AC 119 ms
56,732 KB
testcase_22 AC 123 ms
56,692 KB
testcase_23 AC 130 ms
56,344 KB
testcase_24 AC 125 ms
56,272 KB
testcase_25 AC 118 ms
56,552 KB
testcase_26 AC 118 ms
55,876 KB
testcase_27 AC 119 ms
56,108 KB
testcase_28 AC 119 ms
55,888 KB
testcase_29 AC 122 ms
56,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal sum = new BigDecimal("0.0000000000");
        for(int i=0; i<N; i++){
            BigDecimal num = new BigDecimal(sc.next());
            sum = sum.add(num);
        }
        String ans=sum.toPlainString();
        System.out.println(ans);
    }
}
0