結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー nCk_cvnCk_cv
提出日時 2016-01-13 06:36:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 169 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 2,297 ms
コンパイル使用メモリ 73,700 KB
実行使用メモリ 58,004 KB
最終ジャッジ日時 2023-09-29 22:32:02
合計ジャッジ時間 7,870 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
56,048 KB
testcase_01 AC 133 ms
56,232 KB
testcase_02 AC 136 ms
56,184 KB
testcase_03 AC 133 ms
57,644 KB
testcase_04 AC 169 ms
56,468 KB
testcase_05 AC 145 ms
53,916 KB
testcase_06 AC 151 ms
56,160 KB
testcase_07 AC 148 ms
56,444 KB
testcase_08 AC 155 ms
56,332 KB
testcase_09 AC 157 ms
56,172 KB
testcase_10 AC 135 ms
56,488 KB
testcase_11 AC 143 ms
56,692 KB
testcase_12 AC 140 ms
56,224 KB
testcase_13 AC 136 ms
54,780 KB
testcase_14 AC 136 ms
56,228 KB
testcase_15 AC 154 ms
56,516 KB
testcase_16 AC 134 ms
56,236 KB
testcase_17 AC 129 ms
56,384 KB
testcase_18 AC 153 ms
56,776 KB
testcase_19 AC 142 ms
56,444 KB
testcase_20 AC 134 ms
55,764 KB
testcase_21 AC 136 ms
58,004 KB
testcase_22 AC 143 ms
56,904 KB
testcase_23 AC 153 ms
56,400 KB
testcase_24 AC 144 ms
56,796 KB
testcase_25 AC 135 ms
56,844 KB
testcase_26 AC 133 ms
56,384 KB
testcase_27 AC 134 ms
56,524 KB
testcase_28 AC 131 ms
56,056 KB
testcase_29 AC 141 ms
56,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.io.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigDecimal bd = new BigDecimal("0.0");
		for(int i = 0; i < N; i++) {
			bd = bd.add(sc.nextBigDecimal());
		}
		String str = bd.toString();
		int len = str.split("\\.")[1].length();
		for(int i = len; i < 10; i++) {
			str += "0";
		}
		System.out.println(str);
	}
 }
0