結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,760 KB
testcase_01 AC 32 ms
52,280 KB
testcase_02 AC 32 ms
52,640 KB
testcase_03 AC 37 ms
53,020 KB
testcase_04 AC 37 ms
53,276 KB
testcase_05 AC 33 ms
52,692 KB
testcase_06 AC 33 ms
52,304 KB
testcase_07 WA -
testcase_08 AC 59 ms
67,856 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 65 ms
76,424 KB
testcase_17 AC 61 ms
76,512 KB
testcase_18 AC 61 ms
76,460 KB
testcase_19 WA -
testcase_20 AC 61 ms
74,336 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(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