結果

問題 No.3072 Sum of sqrt(x)
ユーザー 259_Momone259_Momone
提出日時 2020-09-12 23:26:27
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,565 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 2,879 ms
コンパイル使用メモリ 202,080 KB
実行使用メモリ 19,156 KB
最終ジャッジ日時 2024-05-01 04:44:45
合計ジャッジ時間 63,633 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1,319 ms
18,944 KB
testcase_08 AC 464 ms
18,944 KB
testcase_09 AC 662 ms
19,048 KB
testcase_10 AC 1,493 ms
18,908 KB
testcase_11 AC 1,494 ms
19,072 KB
testcase_12 AC 1,457 ms
19,000 KB
testcase_13 AC 1,445 ms
19,156 KB
testcase_14 AC 1,433 ms
18,908 KB
testcase_15 AC 1,424 ms
18,908 KB
testcase_16 AC 1,442 ms
18,944 KB
testcase_17 AC 1,421 ms
19,000 KB
testcase_18 AC 1,429 ms
19,072 KB
testcase_19 AC 1,417 ms
19,008 KB
testcase_20 AC 1,416 ms
18,972 KB
testcase_21 AC 1,436 ms
19,096 KB
testcase_22 AC 1,422 ms
19,000 KB
testcase_23 AC 1,418 ms
18,908 KB
testcase_24 AC 1,433 ms
18,932 KB
testcase_25 AC 1,565 ms
18,940 KB
testcase_26 AC 1,466 ms
19,044 KB
testcase_27 AC 1,343 ms
18,944 KB
testcase_28 AC 1,359 ms
19,108 KB
testcase_29 AC 1,377 ms
18,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

int main(){
    using namespace std;
    unsigned long N;
    scanf("%lu", &N);
    vector<long double> v(N + 1);
    for(unsigned long i{1}, t; i <= N; ++i){
        scanf("%lu", &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];
    for(unsigned long i{1}; i <= N; ++i)printf("%.18Lg\n", v[i] += v[i & (i - 1)]);
    return 0;
}
0