結果

問題 No.1329 Square Sqsq
ユーザー くれちーくれちー
提出日時 2021-01-08 21:34:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 380 bytes
コンパイル時間 4,914 ms
コンパイル使用メモリ 343,176 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-28 02:14:54
合計ジャッジ時間 8,389 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <boost/multiprecision/cpp_int.hpp>
#include <iostream>

using boost::multiprecision::cpp_int;

int main() {
  cpp_int n;
  std::cin >> n;

  cpp_int ng = n, ok = 0;
  while (ng - ok > 1) {
    cpp_int mid = (ng + ok) / 2;
    if (mid * mid <= n) {
      ok = mid;
    } else {
      ng = mid;
    }
  }
  size_t ans = ok.str().size();

  std::cout << ans << std::endl;
}
0