結果
| 問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-03-14 10:42:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,117 bytes |
| コンパイル時間 | 631 ms |
| コンパイル使用メモリ | 69,556 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-15 01:04:04 |
| 合計ジャッジ時間 | 1,610 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 3 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
#define RREP(i,s,e) for (i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8
typedef long long ll;
int main() {
int i, n;
ll ua, la;
cin >> n;
ua = la = 0;
rep (i,n) {
string s;
ll u, l = 0;
size_t len;
cin >> s;
u = stoll(s,&len);
if (len < s.size()) {
string t;
t = s.substr(len+1);
while (t.size() < 10)
t.push_back('0');
l = stoll(t);
}
ua += u;
if (stod(s) >= 0)
la += l;
else
la -= l;
if (ua * la < 0) {
if (ua > 0) {
ua--;
la += 10000000000;
}
else {
ua++;
la -= 10000000000;
}
}
}
cout << ua + la / 10000000000 << '.' << setw(10) << setfill('0') << abs(la) % 10000000000 << endl;
return 0;
}
h_noson