結果

問題 No.48 ロボットの操縦
ユーザー kotakota
提出日時 2022-05-18 15:04:25
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 288 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 19,018 ms
コンパイル使用メモリ 414,740 KB
実行使用メモリ 50,556 KB
最終ジャッジ日時 2023-10-14 22:40:31
合計ジャッジ時間 24,438 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 286 ms
50,304 KB
testcase_01 AC 285 ms
50,320 KB
testcase_02 AC 288 ms
50,464 KB
testcase_03 AC 283 ms
50,212 KB
testcase_04 AC 281 ms
50,236 KB
testcase_05 AC 284 ms
50,344 KB
testcase_06 AC 281 ms
50,328 KB
testcase_07 AC 280 ms
50,188 KB
testcase_08 AC 285 ms
50,468 KB
testcase_09 AC 284 ms
50,356 KB
testcase_10 AC 285 ms
50,216 KB
testcase_11 AC 285 ms
50,276 KB
testcase_12 AC 286 ms
50,208 KB
testcase_13 AC 286 ms
50,556 KB
testcase_14 AC 284 ms
50,212 KB
testcase_15 AC 284 ms
50,280 KB
testcase_16 AC 283 ms
50,300 KB
testcase_17 AC 283 ms
50,308 KB
testcase_18 AC 285 ms
50,312 KB
testcase_19 AC 285 ms
50,180 KB
testcase_20 AC 283 ms
50,344 KB
testcase_21 AC 286 ms
50,188 KB
testcase_22 AC 283 ms
50,372 KB
testcase_23 AC 283 ms
50,220 KB
testcase_24 AC 285 ms
50,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val x = readLine()!!.toDouble()
    val y = readLine()!!.toDouble()
    val l = readLine()!!.toDouble()

    var count = 0.0
    if (y >= 0) {
        count += Math.ceil(y / l)
        if (x != 0.0) {
            count += (1 + Math.ceil(Math.abs(x) / l))
        }
    } else if (y < 0) {
        count += (1 + Math.ceil(Math.abs(x) / l))
        if (y != 0.0) {
            count += (1 + Math.ceil(Math.abs(y) / l))
        }
    }
    println(count.toInt())
}
0