結果

問題 No.1700 floor X
ユーザー bluemeganebluemegane
提出日時 2021-10-09 06:58:42
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 63,280 KB
実行使用メモリ 24,748 KB
最終ジャッジ日時 2023-10-01 00:17:47
合計ジャッジ時間 10,100 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
20,780 KB
testcase_01 AC 102 ms
18,732 KB
testcase_02 AC 101 ms
20,720 KB
testcase_03 AC 103 ms
20,676 KB
testcase_04 AC 102 ms
20,644 KB
testcase_05 AC 101 ms
20,732 KB
testcase_06 AC 104 ms
20,760 KB
testcase_07 AC 105 ms
20,688 KB
testcase_08 AC 103 ms
20,724 KB
testcase_09 AC 101 ms
20,772 KB
testcase_10 AC 102 ms
20,716 KB
testcase_11 AC 101 ms
20,736 KB
testcase_12 AC 103 ms
20,832 KB
testcase_13 AC 104 ms
20,724 KB
testcase_14 AC 103 ms
20,736 KB
testcase_15 AC 101 ms
20,652 KB
testcase_16 AC 101 ms
18,780 KB
testcase_17 AC 103 ms
20,708 KB
testcase_18 AC 108 ms
20,748 KB
testcase_19 AC 103 ms
20,720 KB
testcase_20 AC 103 ms
20,780 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 #

using System;

public class Hello
{
    static void Main()
    {
        var t = int.Parse(Console.ReadLine().Trim());
        while (t-- > 0)
        {
            var n = long.Parse(Console.ReadLine().Trim());
            Console.WriteLine(getAns(n));
        }
    }
    static long getAns(long n)
    {
        if (n == 1) return 1;
        var ok = 1L;
        var ng = n;
        while (ng - ok > 1)
        {
            var mid = ok + (ng - ok) / 2L;
            if (mid * mid <= n) ok = mid;
            else ng = mid;
        }
        return ok;
    }
}
0