結果
| 問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2017-09-12 00:10:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,414 bytes |
| コンパイル時間 | 986 ms |
| コンパイル使用メモリ | 102,876 KB |
| 実行使用メモリ | 817,624 KB |
| 最終ジャッジ日時 | 2024-11-07 15:57:02 |
| 合計ジャッジ時間 | 4,766 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 2 MLE * 1 -- * 24 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000000000000000000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
int n;
cin >> n;
long long a = 0, b = 0;
REP(i, n) {
string s;
cin >> s;
int multi = 1;
if (s[0] == '-') multi = -1;
string big,small;
int done = 0;
for (int q = 0;q < s.length();++q) {
if (s[q] == '.') {
done = 1;
}
else if (done == 0) {
big.push_back(s[q]);
}
else small.push_back(s[q]);
}
while (small.size() != 10) {
small.push_back('0');
}
a += stoll(big)*multi;
b += stoll(small)*multi;
}
a += b / 10000000000;
b = b % 10000000000;
cout << a << ".";
string s;
s = to_string(b);
while (s.length() != 10) s.push_back('0');
cout << s;
cout << endl;
return 0;
}
kotamanegi