結果

問題 No.112 ややこしい鶴亀算
ユーザー javyjavy
提出日時 2015-11-11 16:16:29
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 718 bytes
コンパイル時間 10,520 ms
コンパイル使用メモリ 434,300 KB
実行使用メモリ 57,112 KB
最終ジャッジ日時 2024-04-30 06:21:05
合計ジャッジ時間 17,580 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 269 ms
56,924 KB
testcase_01 AC 265 ms
56,808 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 271 ms
57,068 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 262 ms
56,812 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 271 ms
56,836 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 269 ms
56,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:6:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:18:44: warning: no cast needed
    val inputArrLong = readLineLongArray() as List<Long>
                                           ^

ソースコード

diff #

package Yukicoder

/**
 * Created by hichikawa on 2015/11/11.
 */
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()
    }
    readLine()
    val inputArrLong = readLineLongArray() as List<Long>
    var countKame = 0
    var countTsuru = 0
    for (lo in inputArrLong) {
        if (lo == 4.toLong()) {
            countKame++
        } else {
            countTsuru++
        }
    }
    println(countKame.toString() + " " + countTsuru.toString())
}
0