結果

問題 No.3072 Sum of sqrt(x)
ユーザー rabimearabimea
提出日時 2023-10-27 20:13:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 405 bytes
コンパイル時間 2,810 ms
コンパイル使用メモリ 198,676 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-27 20:14:41
合計ジャッジ時間 39,546 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,372 KB
testcase_02 AC 2 ms
4,372 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 2 ms
4,372 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,372 KB
testcase_07 TLE -
testcase_08 AC 1,833 ms
4,372 KB
testcase_09 AC 1,995 ms
4,372 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using ld = long double;
using ll = long long;

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

	int n; cin >> n;
	
	ld sum = 0, c = 0;
	while(n --) {
		ll _x; // scanf("%lld", &_x);
		cin >> _x;
		ld x = sqrt(ld(_x));
		
		x = x + c;
		ld t = sum + x;
		c = t - sum - x;
		sum = t;
		
		cout.precision(18);
		//~ printf("%.18Lf\n", sum);
		cout << sum << '\n';
	}
}
0