結果

問題 No.1285 ゴミ捨て
ユーザー KodaiKodai
提出日時 2020-11-16 11:39:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 12,476 KB
最終ジャッジ日時 2023-08-19 07:22:55
合計ジャッジ時間 3,541 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,856 KB
testcase_01 AC 14 ms
7,840 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 15 ms
7,852 KB
testcase_04 AC 14 ms
7,880 KB
testcase_05 AC 14 ms
7,852 KB
testcase_06 AC 15 ms
7,872 KB
testcase_07 AC 238 ms
12,304 KB
testcase_08 AC 24 ms
8,268 KB
testcase_09 AC 106 ms
9,896 KB
testcase_10 AC 203 ms
11,776 KB
testcase_11 AC 185 ms
11,504 KB
testcase_12 AC 142 ms
10,428 KB
testcase_13 AC 139 ms
10,644 KB
testcase_14 AC 227 ms
12,016 KB
testcase_15 AC 157 ms
10,808 KB
testcase_16 AC 57 ms
8,936 KB
testcase_17 AC 56 ms
8,912 KB
testcase_18 AC 50 ms
9,020 KB
testcase_19 AC 95 ms
9,876 KB
testcase_20 AC 47 ms
8,728 KB
testcase_21 AC 65 ms
9,036 KB
testcase_22 AC 236 ms
12,476 KB
testcase_23 AC 240 ms
12,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = [int(input()) for i in range(n)]
A.sort()
group = []
for a in A:
    flag = True
    for i, g in enumerate(group):
        if g + 1 < a:
            group[i] = a
            flag = False
            break
    if flag:
        group.append(a)

print(len(group))
0