結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 301 ms
53,792 KB
testcase_01 AC 301 ms
53,792 KB
testcase_02 AC 303 ms
53,808 KB
testcase_03 AC 310 ms
53,932 KB
testcase_04 AC 295 ms
53,708 KB
testcase_05 AC 305 ms
53,884 KB
testcase_06 AC 305 ms
53,920 KB
testcase_07 WA -
testcase_08 AC 391 ms
55,372 KB
testcase_09 AC 537 ms
58,772 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 483 ms
58,884 KB
testcase_17 AC 490 ms
58,752 KB
testcase_18 AC 494 ms
58,780 KB
testcase_19 WA -
testcase_20 AC 486 ms
58,760 KB
testcase_21 AC 496 ms
58,764 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()
    arr.reverse()
    
    var now = Long.MAX_VALUE
    var cnt = 1
    for (i in arr.indices) {
        val ai : Long = arr[i]
        if (ai + 1 < now) {
            now = ai
        } else {
            now = ai
            cnt++
        }
    }

    println(cnt)
}
0