結果
問題 |
No.8072 Sum of sqrt(x)
|
ユーザー |
![]() |
提出日時 | 2020-06-05 19:04:08 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 7,410 ms |
コンパイル使用メモリ | 105,960 KB |
最終ジャッジ日時 | 2025-01-10 21:50:46 |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 TLE * 6 |
ソースコード
#include <iostream> #include <iomanip> #include <cmath> int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); std::cout << std::setprecision(17); int n; std::cin >> n; double s = 0, t, r = 0; for (int i = 0; i < n; i++) { double x; std::cin >> x; x = sqrt(x) + r; t = s + x; r = x - (t - s); s = t; std::cout << s << "\n"; } }