結果

問題 No.791 うし数列
ユーザー 💕💖💞💕💖💞
提出日時 2019-05-06 16:16:30
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 11,211 ms
コンパイル使用メモリ 434,544 KB
実行使用メモリ 57,152 KB
最終ジャッジ日時 2024-04-30 20:31:04
合計ジャッジ時間 17,826 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 310 ms
56,872 KB
testcase_01 AC 318 ms
56,908 KB
testcase_02 AC 309 ms
56,920 KB
testcase_03 AC 309 ms
56,900 KB
testcase_04 AC 316 ms
56,864 KB
testcase_05 AC 312 ms
56,920 KB
testcase_06 AC 314 ms
56,976 KB
testcase_07 AC 319 ms
57,064 KB
testcase_08 AC 320 ms
56,940 KB
testcase_09 AC 320 ms
56,944 KB
testcase_10 AC 319 ms
57,048 KB
testcase_11 AC 313 ms
57,140 KB
testcase_12 AC 313 ms
57,152 KB
testcase_13 AC 314 ms
56,968 KB
testcase_14 AC 314 ms
56,964 KB
testcase_15 AC 312 ms
56,812 KB
testcase_16 AC 319 ms
56,968 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^

ソースコード

diff #

fun main(args:Array<String>) {
    val ml = readLine()!!.toList().map { it.toString().toInt() }.toMutableList()
    val head = ml[0]
    ml.removeAt(0)
    when {
        head == 1 && ml.size >= 1 && ml.all { it == 3 } -> ml.size
        else ->  -1
    }.let { println(it) }
}
0