結果

問題 No.48 ロボットの操縦
ユーザー javyjavy
提出日時 2015-11-02 23:50:35
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 300 ms / 5,000 ms
コード長 802 bytes
コンパイル時間 12,131 ms
コンパイル使用メモリ 437,984 KB
実行使用メモリ 49,832 KB
最終ジャッジ日時 2024-04-30 03:13:20
合計ジャッジ時間 21,141 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 295 ms
49,828 KB
testcase_01 AC 292 ms
49,776 KB
testcase_02 AC 289 ms
49,800 KB
testcase_03 AC 288 ms
49,808 KB
testcase_04 AC 286 ms
49,512 KB
testcase_05 AC 300 ms
49,512 KB
testcase_06 AC 292 ms
49,692 KB
testcase_07 AC 288 ms
49,660 KB
testcase_08 AC 288 ms
49,740 KB
testcase_09 AC 292 ms
49,688 KB
testcase_10 AC 291 ms
49,504 KB
testcase_11 AC 283 ms
49,652 KB
testcase_12 AC 290 ms
49,716 KB
testcase_13 AC 291 ms
49,748 KB
testcase_14 AC 291 ms
49,632 KB
testcase_15 AC 287 ms
49,724 KB
testcase_16 AC 288 ms
49,716 KB
testcase_17 AC 289 ms
49,832 KB
testcase_18 AC 294 ms
49,508 KB
testcase_19 AC 296 ms
49,616 KB
testcase_20 AC 295 ms
49,508 KB
testcase_21 AC 293 ms
49,624 KB
testcase_22 AC 294 ms
49,612 KB
testcase_23 AC 292 ms
49,472 KB
testcase_24 AC 297 ms
49,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

/**
 * Created by hichikawa on 2015/11/02.
 */
fun main(args: Array<String>) {
    fun readLineLongArray() : List<Long> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toLong() }
        return ret
    }
    fun readLineLong() : Long {
        val str = readLine() as String
        return str.toLong()
    }
    val intX = readLineLong()
    val intY = readLineLong()
    val intL = readLineLong()
    var count = Math.abs(intX) / intL + Math.abs(intY) / intL
    if (Math.abs(intX) % intL > 0)
        count += 1
    if (Math.abs(intY) % intL > 0)
        count += 1

    if (intY < 0) {
        println(count+2)
    } else if (intX != 0.toLong()) {
        println(count+1)
    } else {
        println(count)
    }
}
0