結果

問題 No.1700 floor X
ユーザー mmn15277198
提出日時 2021-10-09 06:53:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 504 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 92,108 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-03 10:38:35
合計ジャッジ時間 2,893 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>

using namespace std;

int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long ok = 2e9;
    long long ng = 0;
    while (ok - ng > 1) {
      long long m = (ok + ng) / 2;
      if (m * m > n) {
        ok = m;
      } else {
        ng = m;
      }
    }
    cout << ok - 1 << endl;
  }
  return 0;
}
0