結果

問題 No.3072 Sum of sqrt(x)
ユーザー rabimearabimea
提出日時 2023-10-27 20:23:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 3,107 ms
コンパイル使用メモリ 198,832 KB
実行使用メモリ 5,124 KB
最終ジャッジ日時 2023-10-27 20:24:04
合計ジャッジ時間 44,537 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

using ld = 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