結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー 37zigen37zigen
提出日時 2020-03-22 04:57:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 148 ms / 5,000 ms
コード長 909 bytes
コンパイル時間 2,071 ms
コンパイル使用メモリ 81,516 KB
実行使用メモリ 56,892 KB
最終ジャッジ日時 2023-09-29 22:51:22
合計ジャッジ時間 8,015 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
56,200 KB
testcase_01 AC 137 ms
56,056 KB
testcase_02 AC 135 ms
56,336 KB
testcase_03 AC 126 ms
56,284 KB
testcase_04 AC 134 ms
56,212 KB
testcase_05 AC 129 ms
56,144 KB
testcase_06 AC 129 ms
56,140 KB
testcase_07 AC 134 ms
56,244 KB
testcase_08 AC 128 ms
56,104 KB
testcase_09 AC 141 ms
55,868 KB
testcase_10 AC 126 ms
56,176 KB
testcase_11 AC 133 ms
56,892 KB
testcase_12 AC 131 ms
56,080 KB
testcase_13 AC 129 ms
56,108 KB
testcase_14 AC 130 ms
56,696 KB
testcase_15 AC 139 ms
56,144 KB
testcase_16 AC 128 ms
56,580 KB
testcase_17 AC 129 ms
56,116 KB
testcase_18 AC 148 ms
56,080 KB
testcase_19 AC 132 ms
56,284 KB
testcase_20 AC 139 ms
56,560 KB
testcase_21 AC 140 ms
55,812 KB
testcase_22 AC 136 ms
56,180 KB
testcase_23 AC 142 ms
56,084 KB
testcase_24 AC 142 ms
56,224 KB
testcase_25 AC 139 ms
56,048 KB
testcase_26 AC 137 ms
56,052 KB
testcase_27 AC 130 ms
56,236 KB
testcase_28 AC 131 ms
54,816 KB
testcase_29 AC 134 ms
56,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		long t = System.currentTimeMillis();
		new Main().run();
		System.err.println(System.currentTimeMillis() - t);
	}
	
	
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		BigDecimal ret=new BigDecimal(0);
		for(int i=0;i<N;++i) {
			BigDecimal a=new BigDecimal(sc.next());
			ret=ret.add(a);
		}
		String str=ret.toString();
		int p=0;
		while(p<str.length()&&str.charAt(p)!='.')++p;
		if(p!=str.length()) {
			int n=str.length();
			for(int i=0;i<10-(n-1-p);++i) str=str+"0";
		}else {
			str=str+".";
			for(int i=0;i<10;++i)str=str+"0";
		}
		System.out.println(str);
	}


	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0