結果

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

ソースコード

diff #

fun main() {
    readLine()
    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