結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー ngtkana
提出日時 2020-04-07 23:16:19
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 190,900 KB
最終ジャッジ日時 2025-01-09 14:57:01
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:21: warning: use of ‘ll’ length modifier with ‘f’ type character has either no effect or undefined behavior [-Wformat=]
   14 |     printf("%10.10llf\n",ans);
      |                     ^

ソースコード

diff #

#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using ld=long double;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(10);
    lint n;std::cin>>n;
    ld ans=0;
    while(n--){
        ld x;std::cin>>x;
        ans+=x;
    }
    printf("%10.10llf\n",ans);
}
0