結果

問題 No.3072 Sum of sqrt(x)
ユーザー hgotohgoto
提出日時 2020-09-26 13:35:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 627 bytes
コンパイル時間 2,963 ms
コンパイル使用メモリ 199,152 KB
実行使用メモリ 5,176 KB
最終ジャッジ日時 2023-09-11 10:02:51
合計ジャッジ時間 22,756 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 280 ms
4,380 KB
testcase_09 AC 638 ms
4,376 KB
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;

inline char getcha() {
  if (ci - cn == cm) {
    fread(cn, 1, cm, stdin);
    ci = cn;
  }
  return *ci++;
}

inline int getint() {
  int A = 0;
  if (ci - cn + 16 > cm) {
    while ((ct = getcha()) >= '0') {
      A = A * 10 + ct - '0';
    }
  } else {
    while ((ct = *ci++) >= '0') {
      A = A * 10 + ct - '0';
    }
  }
  return A;
}

int main() {
  int n = getint();
  long double ans = 0;
  while (n--) {
    int x = getint();
    ans += sqrt((long double)x);
    puts(to_string(ans).c_str());
  }
  return 0;
}
0