結果
| 問題 |
No.8072 Sum of sqrt(x)
|
| ユーザー |
southball02
|
| 提出日時 | 2020-09-12 16:03:06 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,764 bytes |
| コンパイル時間 | 3,295 ms |
| コンパイル使用メモリ | 193,212 KB |
| 最終ジャッジ日時 | 2025-01-14 13:29:29 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 10 TLE * 10 |
ソースコード
#ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define repl(i, a, b) for(ll i = a; i < (b); ++i)
#define repd(i, a, b) for(int i = a; i >= (b); --i)
#define repdl(i, a, b) for(ll i = a; i >= (b); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
#endif
#ifndef _TEMPLATE_IO
#define _TEMPLATE_IO
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void writef(T ...tail) { write(tail...); cout << flush; }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
if (v.size()) {
rep(i, 0, sz(v) - 1)
out << v[i] << " ";
out << v.back();
}
return out;
}
#endif
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
int n; read(n);
typedef long double ld;
ld sum = 0.0;
char buf[50];
rep(i, 0, n) {
ld x; read(x);
#pragma fast-math push
#pragma fast-math on
sum += sqrtl(x);
#pragma fast-math pop
sprintf(buf, "%.20Lf", sum);
rep(j, 0, 19) cout << buf[j];
cout << '\n';
}
}
southball02