結果
| 問題 | No.1268 Fruit Rush 2 |
| コンテスト | |
| ユーザー |
stnkien
|
| 提出日時 | 2020-10-24 04:02:22 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 152 ms / 2,000 ms |
| コード長 | 212 bytes |
| 記録 | |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 85,572 KB |
| 実行使用メモリ | 180,616 KB |
| 最終ジャッジ日時 | 2026-04-03 05:01:56 |
| 合計ジャッジ時間 | 6,795 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
from collections import defaultdict
N = int(input())
*A, = map(int, input().split())
A.sort()
dp = defaultdict(int)
for a in A:
dp[a] += 1
if a-1 in dp:
dp[a+1] += dp[a-1]
print(sum(dp.values()))
stnkien