結果
| 問題 |
No.1268 Fruit Rush 2
|
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2020-11-30 23:20:24 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 569 ms / 2,000 ms |
| コード長 | 193 bytes |
| コンパイル時間 | 287 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 63,520 KB |
| 最終ジャッジ日時 | 2024-09-13 02:40:06 |
| 合計ジャッジ時間 | 10,019 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
from collections import defaultdict
N = int(input())
A = list(map(int, input().split()))
A.sort()
d = defaultdict(int)
for a in A:
d[a] += 1
d[a + 1] += d[a - 1]
print(sum(d.values()))
tktk_snsn