結果
| 問題 |
No.8072 Sum of sqrt(x)
|
| ユーザー |
|
| 提出日時 | 2023-10-27 20:31:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,441 ms / 2,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 4,657 ms |
| コンパイル使用メモリ | 191,144 KB |
| 最終ジャッジ日時 | 2025-02-17 14:20:03 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#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 = x - (t - sum);
sum = t;
//~ printf("%.18Lf\n", sum);
cout << sum << '\n';
}
}