結果

問題 No.113 宝探し
ユーザー javyjavy
提出日時 2015-12-07 03:59:27
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 275 ms / 5,000 ms
コード長 1,378 bytes
コンパイル時間 12,625 ms
コンパイル使用メモリ 434,744 KB
実行使用メモリ 49,884 KB
最終ジャッジ日時 2024-04-28 07:32:28
合計ジャッジ時間 21,231 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 256 ms
49,624 KB
testcase_01 AC 253 ms
49,828 KB
testcase_02 AC 254 ms
49,644 KB
testcase_03 AC 254 ms
49,688 KB
testcase_04 AC 275 ms
49,732 KB
testcase_05 AC 258 ms
49,728 KB
testcase_06 AC 249 ms
49,748 KB
testcase_07 AC 260 ms
49,756 KB
testcase_08 AC 248 ms
49,644 KB
testcase_09 AC 252 ms
49,720 KB
testcase_10 AC 253 ms
49,720 KB
testcase_11 AC 262 ms
49,524 KB
testcase_12 AC 254 ms
49,604 KB
testcase_13 AC 256 ms
49,668 KB
testcase_14 AC 253 ms
49,740 KB
testcase_15 AC 263 ms
49,828 KB
testcase_16 AC 254 ms
49,640 KB
testcase_17 AC 253 ms
49,660 KB
testcase_18 AC 252 ms
49,812 KB
testcase_19 AC 254 ms
49,728 KB
testcase_20 AC 262 ms
49,596 KB
testcase_21 AC 260 ms
49,520 KB
testcase_22 AC 268 ms
49,884 KB
testcase_23 AC 259 ms
49,812 KB
testcase_24 AC 256 ms
49,616 KB
testcase_25 AC 264 ms
49,628 KB
testcase_26 AC 266 ms
49,764 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

package Yukicoder

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()
    }

    fun readLineInt(): Int {
        val str = readLine() as String
        return str.toInt()
    }

    fun readLineIntArray() : List<Int> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toInt() }
        return ret
    }

    fun readLineDoubleArray(): List<Double> {
        val str = readLine() as String
        val arrStr = str.split(" ")
        val ret = arrStr.map { it.toDouble() }
        return ret
    }

    fun readLineDouble() : Double {
        val str = readLine() as String
        return str.toDouble()
    }


//    fun readLineStringArray(): List<String> {
//        val str = readLine() as String
//        val arrStr = str.split(" ")
//        return arrStr
//    }

    val input = readLine() as String
    var ns = 0
    var ew = 0
    for (char in input) {
        when (char) {
            'N' -> ns++
            'S' -> ns--
            'E' -> ew++
            'W' -> ew--
        }
    }
    println(Math.sqrt((ns*ns + ew*ew).toDouble()))
}
0