結果

問題 No.3072 Sum of sqrt(x)
ユーザー uwiuwi
提出日時 2020-09-12 15:51:16
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 1,013 bytes
コンパイル時間 7,086 ms
コンパイル使用メモリ 76,188 KB
実行使用メモリ 74,504 KB
最終ジャッジ日時 2023-08-30 13:50:00
合計ジャッジ時間 25,279 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
62,536 KB
testcase_01 AC 122 ms
56,132 KB
testcase_02 AC 127 ms
56,080 KB
testcase_03 AC 128 ms
54,404 KB
testcase_04 AC 120 ms
55,812 KB
testcase_05 AC 121 ms
55,604 KB
testcase_06 AC 124 ms
55,988 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package extra;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Arrays;
import java.util.Scanner;

public class P3072 {
	static Scanner in;
	static PrintWriter out;
	static String INPUT = "";

	static MathContext mc = new MathContext(40);
	static BigDecimal mc(long n){
		return BigDecimal.valueOf(n).sqrt(mc);
	}

	static void solve()
	{
		BigDecimal ret = BigDecimal.ZERO;
		for(int T = ni();T > 0;T--){
			ret = ret.add(mc(nl()));
			out.println(ret.toPlainString());
		}
	}
	
	public static void main(String[] args) throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);
		
		solve();
		out.flush();
	}
	
	static int ni() { return Integer.parseInt(in.next()); }
	static long nl() { return Long.parseLong(in.next()); }
	static double nd() { return Double.parseDouble(in.next()); }
	static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}
0