結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー komkomhkomkomh
提出日時 2019-04-04 14:18:25
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 257 ms / 5,000 ms
コード長 237 bytes
コンパイル時間 8,797 ms
コンパイル使用メモリ 427,372 KB
実行使用メモリ 54,360 KB
最終ジャッジ日時 2024-04-30 20:06:49
合計ジャッジ時間 16,206 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 246 ms
54,144 KB
testcase_01 AC 247 ms
54,124 KB
testcase_02 AC 246 ms
54,148 KB
testcase_03 AC 240 ms
54,300 KB
testcase_04 AC 244 ms
54,252 KB
testcase_05 AC 247 ms
54,120 KB
testcase_06 AC 251 ms
54,144 KB
testcase_07 AC 254 ms
54,300 KB
testcase_08 AC 247 ms
54,128 KB
testcase_09 AC 245 ms
54,268 KB
testcase_10 AC 248 ms
54,360 KB
testcase_11 AC 243 ms
54,136 KB
testcase_12 AC 249 ms
54,120 KB
testcase_13 AC 248 ms
54,244 KB
testcase_14 AC 248 ms
54,220 KB
testcase_15 AC 246 ms
54,268 KB
testcase_16 AC 247 ms
54,048 KB
testcase_17 AC 249 ms
54,248 KB
testcase_18 AC 241 ms
54,196 KB
testcase_19 AC 247 ms
54,316 KB
testcase_20 AC 254 ms
54,244 KB
testcase_21 AC 257 ms
54,212 KB
testcase_22 AC 249 ms
54,152 KB
testcase_23 AC 253 ms
54,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val N: Int = readLine()!!.toInt()
    var count: Int = 0
    var originalMaisu = N

    while (originalMaisu > 1) {
        originalMaisu = originalMaisu / 2 + originalMaisu % 2
        count++
    }
    println(count)
}
0