結果

問題 No.3072 Sum of sqrt(x)
ユーザー rabimearabimea
提出日時 2023-10-27 20:24:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 2,483 ms
コンパイル使用メモリ 200,232 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-27 20:26:04
合計ジャッジ時間 90,480 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 3 ms
4,372 KB
testcase_02 AC 3 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 WA -
testcase_08 AC 450 ms
4,372 KB
testcase_09 AC 606 ms
4,372 KB
testcase_10 AC 846 ms
4,372 KB
testcase_11 AC 1,272 ms
4,376 KB
testcase_12 AC 1,325 ms
4,376 KB
testcase_13 AC 1,352 ms
4,380 KB
testcase_14 AC 1,370 ms
4,376 KB
testcase_15 AC 1,386 ms
4,380 KB
testcase_16 AC 1,344 ms
4,380 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1,339 ms
4,380 KB
testcase_23 AC 1,338 ms
4,380 KB
testcase_24 AC 1,339 ms
4,380 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1,278 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout.precision(18);

	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;
		
		//~ printf("%.18Lf\n", sum);
		cout << sum << '\n';
	}
}
0