結果

問題 No.932 解法破綻!高橋君
ユーザー ichibanshiboriichibanshibori
提出日時 2020-01-05 02:05:23
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 364 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 11,476 ms
コンパイル使用メモリ 427,436 KB
実行使用メモリ 58,664 KB
最終ジャッジ日時 2024-05-02 09:05:05
合計ジャッジ時間 18,344 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
54,528 KB
testcase_01 AC 244 ms
54,164 KB
testcase_02 AC 246 ms
54,180 KB
testcase_03 AC 252 ms
54,120 KB
testcase_04 AC 268 ms
54,060 KB
testcase_05 AC 255 ms
54,032 KB
testcase_06 AC 264 ms
54,072 KB
testcase_07 AC 255 ms
54,052 KB
testcase_08 AC 258 ms
54,180 KB
testcase_09 AC 261 ms
54,264 KB
testcase_10 AC 247 ms
54,212 KB
testcase_11 AC 257 ms
54,064 KB
testcase_12 AC 272 ms
54,080 KB
testcase_13 AC 261 ms
54,064 KB
testcase_14 AC 254 ms
54,280 KB
testcase_15 AC 255 ms
54,076 KB
testcase_16 AC 262 ms
54,256 KB
testcase_17 AC 361 ms
58,604 KB
testcase_18 AC 354 ms
58,664 KB
testcase_19 AC 364 ms
58,400 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