結果
| 問題 |
No.1268 Fruit Rush 2
|
| ユーザー |
|
| 提出日時 | 2020-10-24 01:32:22 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 238 bytes |
| コンパイル時間 | 135 ms |
| コンパイル使用メモリ | 82,420 KB |
| 実行使用メモリ | 133,948 KB |
| 最終ジャッジ日時 | 2024-07-21 14:44:03 |
| 合計ジャッジ時間 | 4,694 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 TLE * 1 -- * 19 |
ソースコード
N = int(input())
A = list(map(int,input().split()))
A.sort()
dic = {a:0 for a in A}
for a in A[::-1]:
dic[a] = 1
if a+2 in dic:
dic[a] += dic[a+2]
res = N
for a in A:
if a+1 in A:
res += dic[a+1]
print(res)