結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー polylogK
提出日時 2017-09-12 03:55:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 832 ms
コンパイル使用メモリ 91,004 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 16:09:12
合計ジャッジ時間 1,663 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39,
                 from main.cpp:1:
In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>]',
    inlined from 'int main()' at main.cpp:26:71:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:233:25: warning: 's' may be used uninitialized [-Wmaybe-uninitialized]
  233 |       { return _M_insert(__f); }
      |                ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:21:23: note: 's' was declared here
   21 |         long double x,s;
      |                       ^

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <string.h>
#include <iomanip>
#include <limits>
using namespace std;

const int MAX_N=20000;
int n;

int main(){
	cin >> n;
	
	long double x,s;
	for(int i=0;i<n;i++){
		cin >> x;
		s+=x;
	}
	cout << fixed << setprecision(numeric_limits<double>::digits10-5) << s << endl;
	return 0;
}
0