
分块
数据结构——分块
NephrenRuqInsania
这个作者很懒,什么都没留下…
展开
-
莫队二次离线
模板 通常来说,满足以下条件的问题 可以莫队 转移复杂度不是O(1)O(1)O(1) 可以使用莫队二次离线优化 对于一个复杂度为 O(nnp)O(n\sqrt np)O(nnp),ppp 不是常数的莫队问题优化到复杂度为 O(nn+np)O(n\sqrt n+np)O(nn+np) 对于模板题,显然暴力莫队的做法是O(nn(14k))O(n\sqrt n \binom{14}{k})O(nn(k14))的,显然炸飞 考虑优化,我们用 f(i,[l,r])f(i,[l,r])f(i,[l,r])原创 2020-08-26 19:05:44 · 308 阅读 · 0 评论 -
[USACO07OPEN] City Horizon
题目描述 Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings. The entire hori...原创 2020-01-31 11:41:31 · 368 阅读 · 0 评论