結果
問題 | No.1268 Fruit Rush 2 |
ユーザー |
![]() |
提出日時 | 2020-10-23 23:09:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 220 ms / 2,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 4,095 ms |
コンパイル使用メモリ | 82,368 KB |
実行使用メモリ | 169,356 KB |
最終ジャッジ日時 | 2024-07-21 12:29:32 |
合計ジャッジ時間 | 6,135 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import sysreadline = sys.stdin.readlinefrom collections import CounterN = int(readline())A = list(map(int, readline().split()))A.sort()SA = set(A)table = Counter()ans = len(A)for a in A:if a-1 in SA:table[a] += 1table[a+2] += table[a]ans += table[a]print(ans)