結果

問題 No.3072 Sum of sqrt(x)
ユーザー 259_Momone259_Momone
提出日時 2020-09-12 23:23:48
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 453 bytes
コンパイル時間 2,990 ms
コンパイル使用メモリ 198,684 KB
実行使用メモリ 19,024 KB
最終ジャッジ日時 2023-08-30 19:35:13
合計ジャッジ時間 16,697 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:10:21: 警告: ‘t’ may be used uninitialized [-Wmaybe-uninitialized]
   10 |         v[i] = sqrtl(t);
      |                ~~~~~^~~
main.cpp:8:29: 備考: ‘t’ はここで定義されています
    8 |     for(unsigned long i{1}, t; i <= N; ++i){
      |                             ^

ソースコード

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", &N);
        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("%.17llg\n", v[i] += v[i & (i - 1)]);
    return 0;
}
0