結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー Mcpu3Mcpu3
提出日時 2019-03-19 15:11:21
言語 Java19
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 4,014 ms
コンパイル使用メモリ 72,444 KB
実行使用メモリ 56,796 KB
最終ジャッジ日時 2023-09-29 22:48:28
合計ジャッジ時間 9,058 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,636 KB
testcase_01 AC 123 ms
56,164 KB
testcase_02 AC 125 ms
55,884 KB
testcase_03 AC 123 ms
55,984 KB
testcase_04 AC 131 ms
56,244 KB
testcase_05 AC 129 ms
55,912 KB
testcase_06 AC 131 ms
55,716 KB
testcase_07 AC 132 ms
56,796 KB
testcase_08 AC 132 ms
55,964 KB
testcase_09 AC 135 ms
56,224 KB
testcase_10 AC 123 ms
55,972 KB
testcase_11 AC 127 ms
56,056 KB
testcase_12 AC 127 ms
55,940 KB
testcase_13 AC 121 ms
55,892 KB
testcase_14 AC 122 ms
56,212 KB
testcase_15 AC 129 ms
55,652 KB
testcase_16 AC 123 ms
55,596 KB
testcase_17 AC 123 ms
55,864 KB
testcase_18 AC 129 ms
55,644 KB
testcase_19 AC 138 ms
55,840 KB
testcase_20 AC 125 ms
55,888 KB
testcase_21 AC 123 ms
55,928 KB
testcase_22 AC 127 ms
55,944 KB
testcase_23 AC 130 ms
55,928 KB
testcase_24 AC 129 ms
55,920 KB
testcase_25 AC 122 ms
55,996 KB
testcase_26 AC 126 ms
56,272 KB
testcase_27 AC 122 ms
55,604 KB
testcase_28 AC 124 ms
56,160 KB
testcase_29 AC 127 ms
55,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigDecimal ans = new BigDecimal("0");
		for (int i = 0; i < N; ++i) {
			String tmp = sc.next();
			BigDecimal A = new BigDecimal(tmp);
			ans = ans.add(A);
		}
		sc.close();
		System.out.print(ans.toString().format("%.10f", ans));
	}
}
0