結果

問題 No.1700 floor X
ユーザー ripityripity
提出日時 2021-12-14 22:43:12
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 709 bytes
コンパイル時間 2,514 ms
コンパイル使用メモリ 71,936 KB
実行使用メモリ 62,464 KB
最終ジャッジ日時 2023-10-01 02:13:11
合計ジャッジ時間 24,156 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,728 KB
testcase_01 AC 373 ms
60,900 KB
testcase_02 AC 357 ms
60,848 KB
testcase_03 AC 375 ms
60,600 KB
testcase_04 AC 371 ms
60,496 KB
testcase_05 AC 367 ms
60,988 KB
testcase_06 AC 373 ms
60,800 KB
testcase_07 AC 375 ms
60,664 KB
testcase_08 AC 384 ms
61,236 KB
testcase_09 AC 398 ms
60,344 KB
testcase_10 AC 367 ms
60,612 KB
testcase_11 AC 363 ms
60,856 KB
testcase_12 AC 362 ms
60,712 KB
testcase_13 AC 367 ms
60,772 KB
testcase_14 AC 378 ms
60,508 KB
testcase_15 AC 364 ms
60,092 KB
testcase_16 AC 362 ms
60,516 KB
testcase_17 AC 363 ms
60,472 KB
testcase_18 AC 376 ms
60,708 KB
testcase_19 AC 370 ms
62,060 KB
testcase_20 AC 362 ms
60,852 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = N+1;
        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