結果

問題 No.1700 floor X
ユーザー ripityripity
提出日時 2021-12-14 22:44:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 415 ms / 2,000 ms
コード長 726 bytes
コンパイル時間 2,304 ms
コンパイル使用メモリ 71,168 KB
実行使用メモリ 62,592 KB
最終ジャッジ日時 2023-09-16 09:39:32
合計ジャッジ時間 20,792 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,992 KB
testcase_01 AC 352 ms
60,696 KB
testcase_02 AC 359 ms
60,380 KB
testcase_03 AC 360 ms
60,504 KB
testcase_04 AC 358 ms
60,700 KB
testcase_05 AC 356 ms
60,332 KB
testcase_06 AC 361 ms
60,312 KB
testcase_07 AC 361 ms
60,412 KB
testcase_08 AC 364 ms
60,600 KB
testcase_09 AC 358 ms
60,500 KB
testcase_10 AC 360 ms
60,412 KB
testcase_11 AC 343 ms
60,128 KB
testcase_12 AC 344 ms
60,436 KB
testcase_13 AC 357 ms
60,320 KB
testcase_14 AC 362 ms
60,508 KB
testcase_15 AC 356 ms
60,676 KB
testcase_16 AC 355 ms
60,180 KB
testcase_17 AC 364 ms
60,356 KB
testcase_18 AC 359 ms
62,384 KB
testcase_19 AC 363 ms
60,332 KB
testcase_20 AC 354 ms
60,268 KB
testcase_21 AC 405 ms
60,336 KB
testcase_22 AC 415 ms
60,332 KB
testcase_23 AC 399 ms
60,480 KB
testcase_24 AC 413 ms
60,684 KB
testcase_25 AC 396 ms
60,504 KB
testcase_26 AC 398 ms
60,880 KB
testcase_27 AC 409 ms
60,840 KB
testcase_28 AC 410 ms
60,344 KB
testcase_29 AC 405 ms
60,868 KB
testcase_30 AC 410 ms
60,444 KB
testcase_31 AC 390 ms
60,960 KB
testcase_32 AC 405 ms
60,440 KB
testcase_33 AC 395 ms
61,932 KB
testcase_34 AC 408 ms
62,244 KB
testcase_35 AC 400 ms
60,688 KB
testcase_36 AC 388 ms
60,492 KB
testcase_37 AC 403 ms
60,412 KB
testcase_38 AC 405 ms
60,828 KB
testcase_39 AC 405 ms
60,544 KB
testcase_40 AC 394 ms
60,772 KB
testcase_41 AC 388 ms
62,592 KB
testcase_42 AC 118 ms
55,692 KB
testcase_43 AC 387 ms
60,092 KB
testcase_44 AC 389 ms
60,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for( int i = 0; i < T; i++ ) {
            long N = sc.nextLong();
            System.out.println(isqrt(N));
        }
        
    }
    
    static long isqrt(long N) {
        
        long low = 0;
        long high = (long)Math.sqrt(N)+10;
        long mid = (low+high)/2;
        while( low < high ) {
            mid = (low+high)/2;
            if( mid*mid <= N ) {
                low = mid+1;
            }else {
                high = mid;
            }
        }
        
        return low-1;
        
    }
    
}
0