結果

問題 No.48 ロボットの操縦
ユーザー komkomhkomkomh
提出日時 2019-04-20 08:51:14
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 466 bytes
コンパイル時間 12,008 ms
コンパイル使用メモリ 410,480 KB
実行使用メモリ 50,560 KB
最終ジャッジ日時 2023-08-13 01:47:23
合計ジャッジ時間 20,463 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
50,340 KB
testcase_01 AC 266 ms
50,160 KB
testcase_02 WA -
testcase_03 AC 269 ms
50,216 KB
testcase_04 AC 266 ms
50,340 KB
testcase_05 AC 267 ms
50,404 KB
testcase_06 AC 271 ms
50,512 KB
testcase_07 AC 265 ms
50,492 KB
testcase_08 AC 273 ms
50,560 KB
testcase_09 AC 271 ms
50,508 KB
testcase_10 AC 269 ms
50,272 KB
testcase_11 AC 265 ms
50,164 KB
testcase_12 AC 268 ms
50,468 KB
testcase_13 AC 272 ms
50,432 KB
testcase_14 AC 270 ms
50,516 KB
testcase_15 AC 273 ms
50,184 KB
testcase_16 AC 270 ms
50,308 KB
testcase_17 AC 269 ms
50,188 KB
testcase_18 AC 273 ms
50,280 KB
testcase_19 AC 275 ms
50,400 KB
testcase_20 AC 272 ms
50,268 KB
testcase_21 AC 269 ms
50,340 KB
testcase_22 AC 268 ms
50,436 KB
testcase_23 AC 267 ms
50,272 KB
testcase_24 AC 269 ms
50,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder

import kotlin.math.absoluteValue

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

    var count = 0
    if (y < 0) {
        count++
    }

    if (x != 0) {
        count++
    }

    count += y.absoluteValue / l
    if (y.absoluteValue % l > 0) {
        count++
    }

    count += x.absoluteValue / l
    if (x.absoluteValue % l > 0) {
        count++
    }
    println(count)
}
0