結果
問題 | No.1285 ゴミ捨て |
ユーザー | shotoyoo |
提出日時 | 2020-11-13 23:42:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 76 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 82,364 KB |
実行使用メモリ | 77,540 KB |
最終ジャッジ日時 | 2024-11-28 21:49:43 |
合計ジャッジ時間 | 2,540 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(max(1000, 10**9)) write = lambda x: sys.stdout.write(x+"\n") n = int(input()) a = [int(input()) for _ in range(n)] a.sort() ans = 0 j = 0 for i in range(n): while j+1<n and a[j+1]<=a[i]+1: j += 1 ans = max(ans, j-i+1) print(ans)