結果

問題 No.341 沈黙の期間
ユーザー javyjavy
提出日時 2016-02-12 22:28:02
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 265 ms / 5,000 ms
コード長 1,490 bytes
コンパイル時間 14,769 ms
コンパイル使用メモリ 422,612 KB
実行使用メモリ 52,124 KB
最終ジャッジ日時 2023-08-12 17:08:58
合計ジャッジ時間 17,230 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 258 ms
50,156 KB
testcase_01 AC 259 ms
50,228 KB
testcase_02 AC 264 ms
50,180 KB
testcase_03 AC 260 ms
50,628 KB
testcase_04 AC 261 ms
52,124 KB
testcase_05 AC 262 ms
50,240 KB
testcase_06 AC 260 ms
50,132 KB
testcase_07 AC 257 ms
50,368 KB
testcase_08 AC 259 ms
50,296 KB
testcase_09 AC 258 ms
50,408 KB
testcase_10 AC 265 ms
50,412 KB
testcase_11 AC 257 ms
50,496 KB
testcase_12 AC 261 ms
50,184 KB
testcase_13 AC 255 ms
50,232 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

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 readLineString() : String {
        return readLine() as String
    }

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

    val str = readLineString()
    var count = 0
    var maxN = 0
    for (ch in str) {
        if (ch == '…') {
            count++
        } else {
            if (maxN < count)
                maxN = count
            count = 0
        }
    }
    if (maxN < count)
        maxN = count
    println(maxN)
}
0