結果

問題 No.1700 floor X
コンテスト
ユーザー vjudge1
提出日時 2026-01-05 18:55:55
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.90.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
+ 700µs
コード長 374 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,135 ms
コンパイル使用メモリ 202,316 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-20 01:29:20
合計ジャッジ時間 5,486 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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