結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー komkomhkomkomh
提出日時 2019-04-04 14:18:25
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 275 ms / 5,000 ms
コード長 237 bytes
コンパイル時間 10,383 ms
コンパイル使用メモリ 415,048 KB
実行使用メモリ 50,556 KB
最終ジャッジ日時 2023-08-13 01:31:38
合計ジャッジ時間 19,126 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
50,092 KB
testcase_01 AC 268 ms
50,052 KB
testcase_02 AC 273 ms
49,988 KB
testcase_03 AC 270 ms
50,088 KB
testcase_04 AC 272 ms
50,048 KB
testcase_05 AC 266 ms
50,140 KB
testcase_06 AC 269 ms
50,260 KB
testcase_07 AC 269 ms
50,392 KB
testcase_08 AC 270 ms
50,132 KB
testcase_09 AC 270 ms
50,072 KB
testcase_10 AC 269 ms
50,132 KB
testcase_11 AC 274 ms
50,288 KB
testcase_12 AC 268 ms
50,244 KB
testcase_13 AC 269 ms
50,292 KB
testcase_14 AC 273 ms
50,248 KB
testcase_15 AC 271 ms
50,156 KB
testcase_16 AC 275 ms
50,556 KB
testcase_17 AC 273 ms
50,180 KB
testcase_18 AC 272 ms
50,208 KB
testcase_19 AC 271 ms
50,132 KB
testcase_20 AC 274 ms
50,104 KB
testcase_21 AC 274 ms
50,444 KB
testcase_22 AC 272 ms
50,232 KB
testcase_23 AC 272 ms
50,036 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