結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー da_louis
提出日時 2020-02-08 16:49:38
言語 Kotlin
(2.4.10 + ACL)
コンパイル:
kotlinc -cp /opt/aclib/ac_library.jar _filename_ -include-runtime -d main.jar
実行:
java -cp main.jar:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 193 ms / 5,000 ms
+ 715µs
コード長 407 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,759 ms
コンパイル使用メモリ 503,636 KB
実行使用メモリ 53,336 KB
最終ジャッジ日時 2026-09-03 23:30:45
合計ジャッジ時間 19,061 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import kotlin.math.abs
import kotlin.math.ceil

fun main(args: Array<String>) {
    p75()
}

fun p75() {
    val (x, y, l) = (1..3).map { readLine()!!.toInt() }

    val answer = ceil(abs(x).toDouble() / l).toInt() + ceil(abs(y).toDouble() / l).toInt() + when (y) {
        in Int.MIN_VALUE..-1 -> 2
        else -> when (x) {
            0 -> 0
            else -> 1
        }
    }

    println(answer)
}
0