結果

問題 No.1700 floor X
ユーザー vjudge1
提出日時 2025-07-11 02:57:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 1,582 ms
コンパイル使用メモリ 160,600 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-07-11 02:57:30
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    int t;
    cin >> t;
    while (t--) {
        long long n;
        cin >> n;
        long long l = 1, r = n;
        long long res = 0;
        while (r - l > 5) {
            long long m = (l + r) / 2;
            if (m * m <= n) l = m;
            else r = m - 1;
        }
        for (long long i = l; i <= r; ++i) {
            if (i * i <= n) res = max(res, i);
        }
        cout << res << '\n';
    }
}
0