結果

問題 No.1700 floor X
ユーザー merlinmerlin
提出日時 2021-10-08 21:53:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 731 bytes
コンパイル時間 2,670 ms
コンパイル使用メモリ 72,208 KB
実行使用メモリ 58,568 KB
最終ジャッジ日時 2023-09-16 08:59:54
合計ジャッジ時間 11,644 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
50,608 KB
testcase_01 AC 147 ms
54,160 KB
testcase_02 AC 150 ms
54,384 KB
testcase_03 AC 149 ms
51,676 KB
testcase_04 AC 146 ms
53,892 KB
testcase_05 AC 151 ms
54,440 KB
testcase_06 AC 147 ms
54,120 KB
testcase_07 AC 153 ms
54,408 KB
testcase_08 AC 150 ms
54,280 KB
testcase_09 AC 157 ms
54,928 KB
testcase_10 AC 148 ms
54,088 KB
testcase_11 AC 151 ms
53,716 KB
testcase_12 AC 153 ms
53,904 KB
testcase_13 AC 155 ms
53,248 KB
testcase_14 AC 151 ms
54,296 KB
testcase_15 AC 154 ms
54,336 KB
testcase_16 AC 153 ms
54,036 KB
testcase_17 AC 151 ms
53,836 KB
testcase_18 AC 150 ms
54,240 KB
testcase_19 AC 152 ms
53,820 KB
testcase_20 AC 142 ms
54,168 KB
testcase_21 AC 162 ms
56,340 KB
testcase_22 AC 164 ms
55,700 KB
testcase_23 AC 163 ms
56,028 KB
testcase_24 AC 167 ms
56,836 KB
testcase_25 AC 166 ms
56,424 KB
testcase_26 AC 163 ms
56,368 KB
testcase_27 AC 167 ms
56,844 KB
testcase_28 AC 165 ms
55,740 KB
testcase_29 AC 163 ms
56,832 KB
testcase_30 AC 163 ms
56,328 KB
testcase_31 AC 161 ms
56,492 KB
testcase_32 AC 166 ms
56,716 KB
testcase_33 AC 161 ms
56,644 KB
testcase_34 AC 167 ms
56,504 KB
testcase_35 AC 163 ms
56,328 KB
testcase_36 AC 164 ms
55,592 KB
testcase_37 AC 166 ms
58,568 KB
testcase_38 AC 163 ms
56,300 KB
testcase_39 AC 166 ms
56,716 KB
testcase_40 AC 165 ms
56,136 KB
testcase_41 AC 162 ms
55,704 KB
testcase_42 AC 66 ms
50,856 KB
testcase_43 AC 165 ms
56,204 KB
testcase_44 AC 157 ms
54,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int t=Integer.parseInt(bu.readLine());
        while(t-->0)
        {
            long n=Long.parseLong(bu.readLine());
            long l=1,r=(int)1e9,mid,ans=l;
            while(l<=r)
            {
                mid=(l+r)>>1;
                if(mid*mid<=n)
                {
                    ans=mid;
                    l=mid+1;
                }
                else r=mid-1;
            }
            sb.append(ans+"\n");
        }
        System.out.print(sb);
    }
}
0