結果
| 問題 | No.8072 Sum of sqrt(x) |
| ユーザー |
👑 |
| 提出日時 | 2025-11-04 23:16:01 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 525 ms / 2,000 ms |
| + 413µs | |
| コード長 | 337 bytes |
| 記録 | |
| コンパイル時間 | 3,760 ms |
| コンパイル使用メモリ | 168,032 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-16 07:48:22 |
| 合計ジャッジ時間 | 103,001 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <stdio.h>
#include <cmath>
#include <iostream>
using ld = long double;
using ll = long long;
int main() {
int n; scanf("%d", &n);
ld ans = 0, res = 0;
for(;n --;) {
ll x; scanf("%lld", &x);
ld a = sqrt((ld)x);
ld t = ans + a + res;
res = a + res - (t - ans);
ans = t;
printf("%.16Lg\n", ans);
}
}