結果

問題 No.182 新規性の虜
ユーザー javyjavy
提出日時 2015-12-07 01:55:12
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 1,530 bytes
コンパイル時間 12,199 ms
コンパイル使用メモリ 437,868 KB
実行使用メモリ 69,884 KB
最終ジャッジ日時 2024-04-30 11:42:12
合計ジャッジ時間 26,235 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 315 ms
56,908 KB
testcase_01 AC 316 ms
56,820 KB
testcase_02 AC 317 ms
56,904 KB
testcase_03 AC 325 ms
56,836 KB
testcase_04 AC 321 ms
56,848 KB
testcase_05 AC 326 ms
56,856 KB
testcase_06 AC 323 ms
56,876 KB
testcase_07 AC 333 ms
56,984 KB
testcase_08 AC 509 ms
65,772 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 331 ms
56,972 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 327 ms
56,816 KB
testcase_24 AC 532 ms
69,808 KB
testcase_25 AC 510 ms
65,564 KB
testcase_26 AC 481 ms
61,452 KB
testcase_27 AC 318 ms
56,808 KB
evil01.txt AC 534 ms
71,824 KB
evil02.txt AC 536 ms
71,852 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:3:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^
Main.kt:47:9: warning: variable 'num' is never used
    val num = readLineInt()
        ^
Main.kt:52:9: warning: variable 'tmp' is assigned but never accessed
    var tmp = Integer.MIN_VALUE
        ^
Main.kt:60:13: warning: the value 'item' assigned to 'var tmp: Int defined in Yukicoder.main' is never used
            tmp = item
            ^

ソースコード

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 num = readLineInt()
    val arrInt = readLineIntArray()

    var count = 0
    var tmpCount = 0
    var tmp = Integer.MIN_VALUE

    for (item in arrInt) {
        if (tmpCount != item) {
            if (tmpCount == 1) {
                count++
            }
            tmpCount = 1
            tmp = item
        } else {
            tmpCount++
        }
    }
    if (tmpCount == 1)
        count++
    println(count)

}
0