結果

問題 No.1700 floor X
コンテスト
ユーザー vjudge1
提出日時 2026-01-05 18:55:55
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.89.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 374 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,496 ms
コンパイル使用メモリ 202,316 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2026-01-05 18:56:00
合計ジャッジ時間 4,615 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int t;
long long x,n;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>t;
    while (t--){
        cin>>n;
        long long x=sqrtl(n);
        while ((x+1)*(x+1)<=n){
            x++;
        }
        while (x*x>n){
            x--;
        }
        cout << x << '\n';
    }
    return 0;
}
0