結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー rutilicusrutilicus
提出日時 2020-08-30 21:50:06
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 320 ms / 5,000 ms
コード長 307 bytes
コンパイル時間 11,317 ms
コンパイル使用メモリ 429,944 KB
実行使用メモリ 56,980 KB
最終ジャッジ日時 2024-04-27 13:24:56
合計ジャッジ時間 17,919 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 257 ms
56,792 KB
testcase_01 AC 256 ms
56,808 KB
testcase_02 AC 278 ms
56,612 KB
testcase_03 AC 261 ms
56,788 KB
testcase_04 AC 269 ms
56,932 KB
testcase_05 AC 260 ms
56,792 KB
testcase_06 AC 260 ms
56,788 KB
testcase_07 AC 260 ms
56,852 KB
testcase_08 AC 260 ms
56,784 KB
testcase_09 AC 268 ms
56,860 KB
testcase_10 AC 257 ms
56,828 KB
testcase_11 AC 258 ms
56,904 KB
testcase_12 AC 259 ms
56,748 KB
testcase_13 AC 254 ms
56,768 KB
testcase_14 AC 261 ms
56,872 KB
testcase_15 AC 267 ms
56,776 KB
testcase_16 AC 268 ms
56,924 KB
testcase_17 AC 259 ms
56,908 KB
testcase_18 AC 264 ms
56,872 KB
testcase_19 AC 266 ms
56,980 KB
testcase_20 AC 265 ms
56,932 KB
testcase_21 AC 320 ms
56,704 KB
testcase_22 AC 259 ms
56,928 KB
testcase_23 AC 256 ms
56,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:15:13: warning: 'appendln(Int): kotlin.text.StringBuilder /* = java.lang.StringBuilder */' is deprecated. Use appendLine instead. Note that the new method always appends the line feed character '\n' regardless of the system line separator.
    builder.appendln(ans)
            ^

ソースコード

diff #

fun main() {
    val builder = StringBuilder()

    val n = readInputLine().toInt()

    var ans = 0

    var current = 1

    while (current < n) {
        ans++
        current *= 2
    }

    builder.appendln(ans)

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}
0