結果

問題 No.3072 Sum of sqrt(x)
ユーザー 259_Momone259_Momone
提出日時 2020-09-12 22:58:25
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 575 bytes
コンパイル時間 1,904 ms
コンパイル使用メモリ 196,900 KB
実行使用メモリ 19,292 KB
最終ジャッジ日時 2024-04-19 10:47:46
合計ジャッジ時間 64,336 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1,352 ms
19,116 KB
testcase_08 AC 573 ms
19,200 KB
testcase_09 AC 747 ms
18,932 KB
testcase_10 AC 1,920 ms
19,112 KB
testcase_11 TLE -
testcase_12 AC 1,953 ms
19,240 KB
testcase_13 AC 1,891 ms
18,936 KB
testcase_14 AC 1,915 ms
18,996 KB
testcase_15 AC 1,918 ms
19,172 KB
testcase_16 AC 1,919 ms
19,080 KB
testcase_17 AC 1,979 ms
19,084 KB
testcase_18 AC 1,895 ms
19,164 KB
testcase_19 AC 1,933 ms
19,144 KB
testcase_20 AC 1,940 ms
19,292 KB
testcase_21 AC 1,872 ms
18,996 KB
testcase_22 AC 1,889 ms
19,148 KB
testcase_23 AC 1,926 ms
19,152 KB
testcase_24 AC 1,905 ms
19,084 KB
testcase_25 AC 1,882 ms
19,068 KB
testcase_26 AC 1,950 ms
19,156 KB
testcase_27 AC 1,514 ms
19,072 KB
testcase_28 AC 1,574 ms
19,068 KB
testcase_29 AC 1,803 ms
19,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

int main(){
    using namespace std;
    unsigned long N;
    cin >> N;
    vector<long double> v(N + 1);
    transform(istream_iterator<unsigned long>(cin), istream_iterator<unsigned long>(), begin(v) + 1, [](const unsigned long& x){return sqrtl(x);});
    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)v[i] += v[i & (i - 1)];
    cout << setprecision(18);
    copy(begin(v) + 1, end(v), ostream_iterator<long double>(cout, "\n"));
    return 0;
}
0