結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー karayuukarayuu
提出日時 2018-11-23 09:31:02
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 267 ms / 5,000 ms
コード長 258 bytes
コンパイル時間 10,754 ms
コンパイル使用メモリ 409,552 KB
実行使用メモリ 50,636 KB
最終ジャッジ日時 2023-08-13 00:59:50
合計ジャッジ時間 18,751 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 257 ms
50,280 KB
testcase_01 AC 258 ms
50,384 KB
testcase_02 AC 262 ms
50,240 KB
testcase_03 AC 258 ms
50,304 KB
testcase_04 AC 257 ms
50,124 KB
testcase_05 AC 264 ms
50,612 KB
testcase_06 AC 254 ms
50,184 KB
testcase_07 AC 255 ms
50,308 KB
testcase_08 AC 258 ms
50,636 KB
testcase_09 AC 253 ms
50,232 KB
testcase_10 AC 257 ms
50,608 KB
testcase_11 AC 254 ms
50,260 KB
testcase_12 AC 260 ms
50,348 KB
testcase_13 AC 257 ms
50,268 KB
testcase_14 AC 260 ms
50,140 KB
testcase_15 AC 262 ms
50,376 KB
testcase_16 AC 266 ms
50,240 KB
testcase_17 AC 260 ms
50,372 KB
testcase_18 AC 258 ms
50,400 KB
testcase_19 AC 267 ms
50,136 KB
testcase_20 AC 258 ms
50,280 KB
testcase_21 AC 260 ms
50,252 KB
testcase_22 AC 262 ms
50,384 KB
testcase_23 AC 258 ms
50,516 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:4:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

/**
 * Created by karayuu on 2018/11/23
 */
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    var d = 1
    var count = 0

    while (d < n) {
        d = d.double()
        count++
    }

    println(count)
}

fun Int.double() = this * 2
0