
RMQ
junior19
abcde
展开
-
CF689D:Friends and Subsequences(ST表 + 二分)
D. Friends and Subsequencestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMike and !Mike are old childhoo原创 2017-05-20 12:09:52 · 450 阅读 · 0 评论 -
Disjoint Sparse Table(不相交散列表)模板
今天看到一道题,有1e6个数,2e7个询问,每个询问给出区间[l,r],对每个询问输出区间内的数之和,由于时间限制很紧,每个询问基本要O(1)回答,然后我了解到这个数据结构可以解决这类问题。# include using namespace std;const int N = 1058576, LOGN = 22;long long v[N][LOGN];long long a[N],原创 2017-11-26 17:20:35 · 391 阅读 · 0 评论