結果

問題 No.1285 ゴミ捨て
ユーザー 👑 H20H20
提出日時 2020-11-15 16:37:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 82,204 KB
最終ジャッジ日時 2023-08-19 07:22:27
合計ジャッジ時間 4,018 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,500 KB
testcase_01 AC 64 ms
71,604 KB
testcase_02 AC 65 ms
71,612 KB
testcase_03 AC 64 ms
71,328 KB
testcase_04 AC 62 ms
71,416 KB
testcase_05 AC 62 ms
71,468 KB
testcase_06 AC 62 ms
71,604 KB
testcase_07 AC 134 ms
82,092 KB
testcase_08 AC 85 ms
76,840 KB
testcase_09 AC 108 ms
80,404 KB
testcase_10 AC 130 ms
81,192 KB
testcase_11 AC 126 ms
81,344 KB
testcase_12 AC 114 ms
81,208 KB
testcase_13 AC 116 ms
80,824 KB
testcase_14 AC 134 ms
81,464 KB
testcase_15 AC 116 ms
81,208 KB
testcase_16 AC 95 ms
78,008 KB
testcase_17 AC 97 ms
78,056 KB
testcase_18 AC 95 ms
77,708 KB
testcase_19 AC 114 ms
79,748 KB
testcase_20 AC 98 ms
77,740 KB
testcase_21 AC 103 ms
78,444 KB
testcase_22 AC 141 ms
82,204 KB
testcase_23 AC 138 ms
82,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = []
USED = [0]*N

for _ in range(N):
    A.append(int(input()))
A.sort()
ans = 0
for i in range(N):
    if USED[i]==0:
        USED[i]=1
        box = A[i]
        ans+=1
        for j in range(N):
            if USED[j]==0 and box+1<A[j]:
                USED[j]=1
                box = A[j]

print(ans)
0