結果

問題 No.1700 floor X
ユーザー vjudge1
提出日時 2025-07-11 02:56:57
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 4,735 ms
コンパイル使用メモリ 208,048 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-07-11 02:57:05
合計ジャッジ時間 8,172 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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