結果

問題 No.48 ロボットの操縦
ユーザー javyjavy
提出日時 2015-11-02 23:50:35
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 259 ms / 5,000 ms
コード長 802 bytes
コンパイル時間 11,428 ms
コンパイル使用メモリ 416,504 KB
実行使用メモリ 50,756 KB
最終ジャッジ日時 2023-08-12 13:24:46
合計ジャッジ時間 19,585 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 250 ms
50,148 KB
testcase_01 AC 255 ms
50,216 KB
testcase_02 AC 254 ms
50,148 KB
testcase_03 AC 253 ms
50,668 KB
testcase_04 AC 257 ms
50,080 KB
testcase_05 AC 252 ms
50,064 KB
testcase_06 AC 258 ms
50,256 KB
testcase_07 AC 259 ms
50,232 KB
testcase_08 AC 257 ms
50,568 KB
testcase_09 AC 250 ms
50,064 KB
testcase_10 AC 254 ms
50,064 KB
testcase_11 AC 259 ms
50,756 KB
testcase_12 AC 254 ms
50,436 KB
testcase_13 AC 255 ms
50,080 KB
testcase_14 AC 249 ms
50,068 KB
testcase_15 AC 250 ms
50,064 KB
testcase_16 AC 246 ms
49,968 KB
testcase_17 AC 251 ms
50,308 KB
testcase_18 AC 254 ms
50,116 KB
testcase_19 AC 254 ms
49,968 KB
testcase_20 AC 246 ms
49,964 KB
testcase_21 AC 247 ms
50,264 KB
testcase_22 AC 256 ms
50,260 KB
testcase_23 AC 254 ms
50,156 KB
testcase_24 AC 255 ms
50,172 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