結果

問題 No.3072 Sum of sqrt(x)
ユーザー trineutrontrineutron
提出日時 2020-06-05 19:04:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 432 bytes
コンパイル時間 1,302 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 5,256 KB
最終ジャッジ日時 2023-09-06 20:03:56
合計ジャッジ時間 29,240 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,388 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 1,481 ms
4,380 KB
testcase_08 AC 623 ms
4,384 KB
testcase_09 AC 848 ms
4,388 KB
testcase_10 AC 1,188 ms
4,388 KB
testcase_11 AC 1,566 ms
4,388 KB
testcase_12 AC 1,684 ms
4,388 KB
testcase_13 AC 1,781 ms
4,508 KB
testcase_14 AC 1,707 ms
4,388 KB
testcase_15 AC 1,688 ms
4,388 KB
testcase_16 AC 1,707 ms
4,388 KB
testcase_17 AC 1,674 ms
5,068 KB
testcase_18 AC 1,677 ms
5,004 KB
testcase_19 AC 1,715 ms
5,004 KB
testcase_20 AC 1,745 ms
4,384 KB
testcase_21 AC 1,672 ms
4,392 KB
testcase_22 AC 1,683 ms
4,392 KB
testcase_23 AC 1,654 ms
4,388 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 AC 1,529 ms
5,256 KB
testcase_28 AC 1,563 ms
5,004 KB
testcase_29 AC 1,593 ms
4,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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