-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
概要
DynamicSegmentTreeが座標圧縮+SegmentTreeに比べて非常に遅い.
詳細
yukicoder上の問題において,座標圧縮+SegmentTreeが177 msしかかかっていないのに対し,DynamicSegmentTreeでは1422 msもかかっている.多くのTLである2000msにも近く,安心して使えるレベルにはない.
現在のDynamicSegmentTreeは突貫工事的にvectorをunordered_mapに置き換えただけの実装になっており,unordered_mapは定数倍が遅いことが多くあるためこれが原因と思われる.
対応
再帰方式にしてポインタで管理する
Metadata
Metadata
Assignees
Labels
No labels