結果
| 問題 | No.81 すべて足すだけの簡単なお仕事です。 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-12 03:55:43 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 454 bytes |
| 記録 | |
| コンパイル時間 | 779 ms |
| コンパイル使用メモリ | 104,152 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-07 23:41:51 |
| 合計ジャッジ時間 | 3,171 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 30 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:24:18: warning: 's' may be used uninitialized [-Wmaybe-uninitialized]
24 | s+=x;
| ~^~~
main.cpp:21:23: note: 's' was declared here
21 | long double x,s;
| ^
ソースコード
#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;
}