結果

問題 No.1285 ゴミ捨て
ユーザー surumeika1987surumeika1987
提出日時 2020-11-19 16:46:47
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 15,805 ms
コンパイル使用メモリ 421,932 KB
実行使用メモリ 61,000 KB
最終ジャッジ日時 2023-09-30 16:22:06
合計ジャッジ時間 26,118 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 282 ms
53,620 KB
testcase_01 AC 284 ms
53,632 KB
testcase_02 AC 290 ms
53,668 KB
testcase_03 AC 294 ms
53,756 KB
testcase_04 AC 282 ms
53,756 KB
testcase_05 AC 300 ms
53,936 KB
testcase_06 AC 298 ms
55,456 KB
testcase_07 WA -
testcase_08 AC 378 ms
55,548 KB
testcase_09 AC 511 ms
60,476 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 459 ms
60,268 KB
testcase_17 AC 463 ms
58,660 KB
testcase_18 AC 458 ms
58,232 KB
testcase_19 WA -
testcase_20 AC 454 ms
58,604 KB
testcase_21 AC 471 ms
58,528 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

fun main() {
    val n_num = readLine()!!.toInt();
    val arr = Array<Long>(n_num) {
        readLine()!!.toLong()
    }
    arr.sort()
    
    var now = -3L
    var cnt = 1
    for (i in arr.indices) {
        val ai : Long = arr[i]
        if (now + 1 < ai) {
            now = ai
        } else {
            now = ai
            cnt++
        }
    }

    println(cnt)
}
0