結果

問題 No.8072 Sum of sqrt(x)
ユーザー trineutron
提出日時 2020-06-10 21:27:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 456 bytes
コンパイル時間 1,423 ms
コンパイル使用メモリ 89,188 KB
最終ジャッジ日時 2025-01-11 00:56:07
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 TLE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cmath>

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(18);
    int n;
    std::cin >> n;
    __float128 s = 0, t, r = 0;
    for (int i = 0; i < n; i++) {
        long double x;
        std::cin >> x;
        x = sqrtl(x) + r;
        t = s + x;
        r = x - (t - s);
        s = t;
        std::cout << (long double) s << "\n";
    }
}
0