結果

問題 No.1700 floor X
ユーザー srjywrdnprkt
提出日時 2023-06-03 15:26:28
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 564 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 104,204 KB
最終ジャッジ日時 2025-02-13 22:21:43
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;
using ll = long long;

ll isqrt(ll s){
    ll l=0, r=3e9, c;
    while(r-l>1){
        c = (l+r)/2;
        if (c*c <= s) l = c;
        else r = c;
    }
    return l;
}

int main(){

    int T;
    cin >> T;
    while(T){
        T--;
        ll N;
        cin >> N;
        cout << isqrt(N) << endl;
    }

    return 0;
}
0