結果
問題 |
No.1285 ゴミ捨て
|
ユーザー |
![]() |
提出日時 | 2022-01-13 07:14:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 290 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 78,464 KB |
最終ジャッジ日時 | 2024-11-16 08:45:42 |
合計ジャッジ時間 | 3,036 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 WA * 12 |
ソースコード
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)