結果

問題 No.1285 ゴミ捨て
ユーザー surumeika1987surumeika1987
提出日時 2020-11-19 16:44:35
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 15,089 ms
コンパイル使用メモリ 420,556 KB
実行使用メモリ 60,616 KB
最終ジャッジ日時 2023-09-30 16:21:20
合計ジャッジ時間 24,886 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 274 ms
53,496 KB
testcase_01 AC 272 ms
53,472 KB
testcase_02 AC 276 ms
53,768 KB
testcase_03 AC 276 ms
53,492 KB
testcase_04 AC 271 ms
53,644 KB
testcase_05 AC 276 ms
53,576 KB
testcase_06 AC 286 ms
53,528 KB
testcase_07 WA -
testcase_08 AC 363 ms
55,280 KB
testcase_09 AC 501 ms
59,164 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 429 ms
58,532 KB
testcase_17 AC 433 ms
58,536 KB
testcase_18 AC 441 ms
58,408 KB
testcase_19 WA -
testcase_20 AC 437 ms
58,808 KB
testcase_21 AC 450 ms
58,420 KB
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    println(cnt)
}
0