結果

問題 No.740 幻の木
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-10-06 16:02:35
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 12,025 ms
コンパイル使用メモリ 436,248 KB
実行使用メモリ 57,044 KB
最終ジャッジ日時 2024-04-30 19:23:51
合計ジャッジ時間 15,723 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 299 ms
56,952 KB
testcase_01 AC 303 ms
56,796 KB
testcase_02 AC 306 ms
56,824 KB
testcase_03 AC 300 ms
56,948 KB
testcase_04 AC 303 ms
56,836 KB
testcase_05 AC 302 ms
56,808 KB
testcase_06 AC 317 ms
57,044 KB
testcase_07 AC 311 ms
56,924 KB
testcase_08 AC 305 ms
56,828 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

fun main(args: Array<String>) {
    val (N, M, P, Q) = readLine()!!.split(" ").map { it.toInt() }
    var n = N
    var m = 1

    for (i in 1..Int.MAX_VALUE) {
        if (m in P until P + Q) {
            n -= M
        }
        n -= M

        m += 1
        if (m > 12) {
            m = 1
        }

        if (n <= 0) {
            println(i)
            break
        }
    }
}
0