結果

問題 No.3072 Sum of sqrt(x)
ユーザー 259_Momone259_Momone
提出日時 2020-09-12 23:13:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,597 ms / 2,000 ms
コード長 538 bytes
コンパイル時間 2,949 ms
コンパイル使用メモリ 199,036 KB
実行使用メモリ 18,844 KB
最終ジャッジ日時 2023-09-13 18:27:41
合計ジャッジ時間 64,695 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 3 ms
4,380 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 2 ms
4,504 KB
testcase_07 AC 1,400 ms
18,544 KB
testcase_08 AC 548 ms
18,844 KB
testcase_09 AC 724 ms
18,716 KB
testcase_10 AC 1,597 ms
18,576 KB
testcase_11 AC 1,541 ms
18,580 KB
testcase_12 AC 1,556 ms
18,632 KB
testcase_13 AC 1,594 ms
18,804 KB
testcase_14 AC 1,555 ms
18,688 KB
testcase_15 AC 1,593 ms
18,536 KB
testcase_16 AC 1,576 ms
18,656 KB
testcase_17 AC 1,538 ms
18,776 KB
testcase_18 AC 1,515 ms
18,624 KB
testcase_19 AC 1,548 ms
18,608 KB
testcase_20 AC 1,527 ms
18,608 KB
testcase_21 AC 1,560 ms
18,636 KB
testcase_22 AC 1,517 ms
18,652 KB
testcase_23 AC 1,531 ms
18,668 KB
testcase_24 AC 1,548 ms
18,624 KB
testcase_25 AC 1,520 ms
18,668 KB
testcase_26 AC 1,533 ms
18,616 KB
testcase_27 AC 1,444 ms
18,508 KB
testcase_28 AC 1,492 ms
18,536 KB
testcase_29 AC 1,518 ms
18,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

int main(){
    using namespace std;
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    unsigned long N;
    cin >> N;
    vector<long double> v(N + 1);
    for(unsigned long i{1}, t; i <= N; ++i){
        cin >> t;
        v[i] = sqrtl(t);
    }
    for(unsigned long i{1}; i <= N; i <<= 1UL)for(unsigned long j{2 * i}; j <= N; j += 2 * i)v[j] += v[j - i];
    cout << setprecision(18);
    for(unsigned long i{1}; i <= N; ++i)cout << (v[i] += v[i & (i - 1)]) << "\n";
    cout << flush;
    return 0;
}
0