結果

問題 No.1285 ゴミ捨て
ユーザー 👑 H20H20
提出日時 2020-11-15 16:37:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 80,752 KB
最終ジャッジ日時 2024-05-06 14:37:04
合計ジャッジ時間 3,210 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,712 KB
testcase_01 AC 38 ms
52,224 KB
testcase_02 AC 35 ms
52,096 KB
testcase_03 AC 34 ms
51,840 KB
testcase_04 AC 38 ms
51,840 KB
testcase_05 AC 36 ms
51,840 KB
testcase_06 AC 36 ms
51,840 KB
testcase_07 AC 116 ms
80,752 KB
testcase_08 AC 63 ms
67,840 KB
testcase_09 AC 89 ms
78,720 KB
testcase_10 AC 114 ms
79,880 KB
testcase_11 AC 109 ms
79,744 KB
testcase_12 AC 97 ms
79,744 KB
testcase_13 AC 99 ms
79,616 KB
testcase_14 AC 117 ms
80,008 KB
testcase_15 AC 103 ms
79,872 KB
testcase_16 AC 76 ms
76,544 KB
testcase_17 AC 76 ms
76,704 KB
testcase_18 AC 75 ms
76,160 KB
testcase_19 AC 86 ms
78,208 KB
testcase_20 AC 74 ms
76,220 KB
testcase_21 AC 80 ms
77,056 KB
testcase_22 AC 123 ms
80,660 KB
testcase_23 AC 124 ms
80,656 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