結果

問題 No.1285 ゴミ捨て
ユーザー lllllll88938494lllllll88938494
提出日時 2022-01-13 07:13:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 384 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 78,456 KB
最終ジャッジ日時 2024-04-28 00:53:00
合計ジャッジ時間 3,389 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,140 KB
testcase_01 AC 31 ms
53,132 KB
testcase_02 AC 31 ms
52,976 KB
testcase_03 AC 30 ms
52,920 KB
testcase_04 AC 30 ms
53,012 KB
testcase_05 AC 32 ms
52,340 KB
testcase_06 AC 31 ms
53,528 KB
testcase_07 WA -
testcase_08 AC 52 ms
68,264 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 67 ms
76,832 KB
testcase_17 AC 64 ms
76,248 KB
testcase_18 AC 75 ms
76,320 KB
testcase_19 WA -
testcase_20 AC 61 ms
74,300 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ns=[int(input()) for i in range(n)]
ns.sort(reverse=True)
lis=[0]*n
cnt=0

def  cal(x):
    lis[x]=1
    now = ns[x]
    for i in range(1,n):
        if lis[i] == 1:
            continue
        if now > ns[i]+1:
            now = ns[i]+1
            lis[i] = 1


for i in range(n):
    if lis[i] == 0:
        cal(i)
        cnt+=1
                    
print(cnt)
    
0