結果

問題 No.279 木の数え上げ
ユーザー javyjavy
提出日時 2015-11-03 02:21:09
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 499 ms / 2,000 ms
コード長 794 bytes
コンパイル時間 12,772 ms
コンパイル使用メモリ 435,876 KB
実行使用メモリ 55,992 KB
最終ジャッジ日時 2024-04-30 05:20:28
合計ジャッジ時間 22,140 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 305 ms
49,856 KB
testcase_01 AC 297 ms
49,920 KB
testcase_02 AC 295 ms
49,892 KB
testcase_03 AC 292 ms
49,652 KB
testcase_04 AC 294 ms
49,676 KB
testcase_05 AC 295 ms
49,712 KB
testcase_06 AC 292 ms
49,868 KB
testcase_07 AC 297 ms
49,852 KB
testcase_08 AC 302 ms
49,916 KB
testcase_09 AC 298 ms
49,716 KB
testcase_10 AC 480 ms
55,956 KB
testcase_11 AC 443 ms
53,084 KB
testcase_12 AC 471 ms
55,516 KB
testcase_13 AC 434 ms
52,704 KB
testcase_14 AC 490 ms
55,992 KB
testcase_15 AC 488 ms
55,836 KB
testcase_16 AC 499 ms
55,668 KB
testcase_17 AC 483 ms
55,736 KB
testcase_18 AC 474 ms
53,844 KB
testcase_19 AC 480 ms
55,552 KB
testcase_20 AC 479 ms
55,988 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 str = readLine() as String
    val numT = str.filter { it == 't' }.length
    val numR = str.filter { it == 'r' }.length
    val numE = str.filter { it == 'e' }.length / 2
    if (numT < numR) {
        if (numT < numE)
            println(numT)
        else
            println(numE)
    } else {
        if (numR < numE)
            println(numR)
        else
            println(numE)
    }
}
0