結果

問題 No.8072 Sum of sqrt(x)
ユーザー hgoto
提出日時 2020-09-26 13:24:47
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.90.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 392 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,556 ms
コンパイル使用メモリ 299,024 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-14 01:56:59
合計ジャッジ時間 16,189 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 TLE * 1 -- * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%d", &n);
      |   ~~~~~^~~~~~~~~~

ソースコード

diff #
raw source code

#include <iostream>

using namespace std;

#include <boost/multiprecision/cpp_dec_float.hpp>
using namespace boost::multiprecision;

int main() {
  cout << fixed << setprecision(17);
  int n;
  scanf("%d", &n);
  number<cpp_dec_float<128>> ans = 0;
  while (n--) {
    number<cpp_dec_float<128>> x;
    cin >> x;
    ans += sqrt(x);
    printf("%.17Lf\n", (long double)ans);
  }
  return 0;
}
0