結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー Pachicobue
提出日時 2017-07-22 03:34:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 65,280 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 04:57:48
合計ジャッジ時間 1,784 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
using ll = long long;
int main()
{
constexpr ll OFFSET=1e10;
ll N;
cin >> N;
ll sum = 0;
for(ll i = 0; i < N; i++){
long double a;
cin >> a;
sum += static_cast<ll>(a*OFFSET);
}
string s = to_string(sum %OFFSET);
const int size = s.size();
for(int i = 0; i < 10-size; i++){
s.push_back('0');
}
cout << sum / OFFSET << "." << s << endl;
return 0;
}
0