結果

問題 No.3072 Sum of sqrt(x)
ユーザー rabimearabimea
提出日時 2023-10-27 20:01:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
OLE  
実行時間 -
コード長 324 bytes
コンパイル時間 3,410 ms
コンパイル使用メモリ 200,908 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-27 20:01:27
合計ジャッジ時間 19,581 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 3 ms
4,348 KB
testcase_02 AC 4 ms
4,348 KB
testcase_03 AC 3 ms
4,348 KB
testcase_04 AC 3 ms
4,348 KB
testcase_05 AC 4 ms
4,348 KB
testcase_06 AC 4 ms
4,348 KB
testcase_07 OLE -
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 #

#include <bits/stdc++.h>
using namespace std;

using ld = long double;

int main() {
	ios::sync_with_stdio(0);

	int n; cin >> n;
	
	ld sum = 0, c = 0;
	while(n --) {
		ld x; cin >> x;
		x = sqrt(x);
		
		x = x + c;
		ld t = sum + x;
		c = t - sum - x;
		sum = t;
		
		cout << fixed << setprecision(18) << sum << '\n';
	}
}
0