結果

問題 No.932 解法破綻!高橋君
ユーザー ichibanshiboriichibanshibori
提出日時 2020-01-05 02:05:23
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 398 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 13,486 ms
コンパイル使用メモリ 414,708 KB
実行使用メモリ 54,416 KB
最終ジャッジ日時 2023-08-14 20:57:57
合計ジャッジ時間 21,462 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 271 ms
50,140 KB
testcase_01 AC 275 ms
50,224 KB
testcase_02 AC 269 ms
50,104 KB
testcase_03 AC 273 ms
50,276 KB
testcase_04 AC 280 ms
50,428 KB
testcase_05 AC 270 ms
50,136 KB
testcase_06 AC 268 ms
50,152 KB
testcase_07 AC 272 ms
50,484 KB
testcase_08 AC 273 ms
50,300 KB
testcase_09 AC 273 ms
50,260 KB
testcase_10 AC 273 ms
50,108 KB
testcase_11 AC 274 ms
50,132 KB
testcase_12 AC 282 ms
50,360 KB
testcase_13 AC 278 ms
50,556 KB
testcase_14 AC 277 ms
50,196 KB
testcase_15 AC 282 ms
50,480 KB
testcase_16 AC 289 ms
50,636 KB
testcase_17 AC 398 ms
54,416 KB
testcase_18 AC 383 ms
54,168 KB
testcase_19 AC 389 ms
54,068 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args: Array<String>) =
         ^

ソースコード

diff #

fun main(args: Array<String>) =
    (readLine() ?: "").let {
        solve(it)
    }.let {
        if (it) "Done!" else "Failed..."
    }.let {
        println(it)
    }

fun solve(str: String) =
    (str.length).let { len ->
        if (len % 3 != 2) {
            false
        }
        else {
            (0..(len - 1)).all {
                when (it % 3) {
                    0 -> str[it] == 'A'
                    1 -> str[it] == 'C'
                    2 -> str[it] == ','
                    else -> throw RuntimeException()
                }
            }
        }
    }
0