結果

問題 No.1686 Geschenkt
ユーザー GatanityHouse
提出日時 2021-10-17 01:43:08
言語 Kotlin
(2.1.0)
結果
WA  
実行時間 -
コード長 336 bytes
コンパイル時間 9,103 ms
コンパイル使用メモリ 429,616 KB
実行使用メモリ 57,012 KB
最終ジャッジ日時 2024-09-17 19:34:07
合計ジャッジ時間 12,619 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val a = readLine()!!.split(" ").map { it.toInt() }

    val result = a
        .filterIndexed { index, value ->
            val beforeValue = a.getOrNull(index - 1)

            if (beforeValue == null) true else {
                (value - beforeValue != 1)
            }
        }
        .sum()
    println(result)
}
0