結果

問題 No.1700 floor X
ユーザー 👑 箱
提出日時 2021-10-08 22:40:08
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 425 ms / 2,000 ms
コード長 1,122 bytes
コンパイル時間 14,623 ms
コンパイル使用メモリ 417,688 KB
実行使用メモリ 61,320 KB
最終ジャッジ日時 2023-09-16 09:20:34
合計ジャッジ時間 35,302 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 262 ms
54,132 KB
testcase_01 AC 403 ms
58,724 KB
testcase_02 AC 398 ms
60,572 KB
testcase_03 AC 396 ms
60,748 KB
testcase_04 AC 400 ms
60,468 KB
testcase_05 AC 404 ms
61,320 KB
testcase_06 AC 402 ms
58,804 KB
testcase_07 AC 402 ms
58,612 KB
testcase_08 AC 399 ms
58,484 KB
testcase_09 AC 403 ms
58,868 KB
testcase_10 AC 406 ms
60,684 KB
testcase_11 AC 401 ms
60,872 KB
testcase_12 AC 416 ms
61,152 KB
testcase_13 AC 400 ms
60,196 KB
testcase_14 AC 403 ms
60,644 KB
testcase_15 AC 406 ms
59,580 KB
testcase_16 AC 404 ms
60,524 KB
testcase_17 AC 402 ms
61,052 KB
testcase_18 AC 399 ms
60,472 KB
testcase_19 AC 401 ms
58,728 KB
testcase_20 AC 401 ms
59,740 KB
testcase_21 AC 401 ms
56,944 KB
testcase_22 AC 402 ms
56,928 KB
testcase_23 AC 405 ms
59,104 KB
testcase_24 AC 403 ms
58,972 KB
testcase_25 AC 398 ms
57,200 KB
testcase_26 AC 399 ms
57,040 KB
testcase_27 AC 397 ms
57,752 KB
testcase_28 AC 400 ms
58,944 KB
testcase_29 AC 407 ms
57,020 KB
testcase_30 AC 404 ms
57,020 KB
testcase_31 AC 404 ms
59,052 KB
testcase_32 AC 401 ms
59,240 KB
testcase_33 AC 425 ms
57,192 KB
testcase_34 AC 406 ms
57,316 KB
testcase_35 AC 403 ms
57,172 KB
testcase_36 AC 404 ms
56,904 KB
testcase_37 AC 407 ms
59,144 KB
testcase_38 AC 401 ms
56,812 KB
testcase_39 AC 406 ms
58,868 KB
testcase_40 AC 405 ms
58,964 KB
testcase_41 AC 402 ms
57,564 KB
testcase_42 AC 257 ms
54,104 KB
testcase_43 AC 402 ms
56,972 KB
testcase_44 AC 403 ms
57,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val numCases = nextInt()
    case@ for (_i in 0 until numCases) {
        val n = nextLong()
        var l = 0L
        var r = 1000000001L
        while (r - l > 1) {
            val mid = (l + r) / 2
            if (mid * mid <= n) {
                l = mid
            } else {
                r = mid
            }
        }
        println(l)
    }
}

fun main() {
    Thread(null, {
        val writer = PrintWriter(System.out, false)
        writer.solve()
        writer.flush()
    }, "solve", 1.shl(26))
        .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
        .apply { start() }.join()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0