結果
問題 | No.1268 Fruit Rush 2 |
ユーザー |
![]() |
提出日時 | 2020-10-23 23:56:23 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 228 bytes |
コンパイル時間 | 218 ms |
コンパイル使用メモリ | 82,284 KB |
実行使用メモリ | 174,252 KB |
最終ジャッジ日時 | 2024-07-21 13:57:02 |
合計ジャッジ時間 | 5,726 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 12 |
ソースコード
from collections import defaultdict N = int(input()) *A, = map(int, input().split()) A.sort() S = set() dp = defaultdict(int) for a in A: if a-1 in S: dp[a+1] = 1 + dp[a-1] S.add(a) print(sum(dp.values()) + N)