莫队
Head_Hard
菜逼一个
展开
-
Codeforces Round #340 (Div. 2) E 【莫队】
链接#includeusing namespace std;#define ll long longconst int MAX = 1e6 + 7;ll ans[MAX * 20], res;int a[MAX], cnt[MAX * 10], n, m, k, sz;struct node{ int l, r, id;} q[MAX];bool cmp(node a原创 2018-03-28 20:02:58 · 147 阅读 · 0 评论 -
SPOJ DOUERY query 【莫队】
Given a sequence of n numbers a1, a2, ..., an and a number of d-queries. A d-query is a pair (i, j) (1 ≤ i ≤ j ≤ n). For each d-query (i, j), you have to return the number of distinct elements in the ...原创 2018-07-19 16:42:12 · 136 阅读 · 0 评论 -
CF 86D Powerful array 【莫队】
D. Powerful arraytime limit per test5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAn array of positive integers a1, a2, ..., an is given. Let us ...原创 2018-07-21 10:14:52 · 143 阅读 · 0 评论 -
BZOJ 2038 小z的袜子 【莫队】
2038: [2009国家集训队]小Z的袜子(hose)Time Limit: 20 Sec Memory Limit: 259 MBSubmit: 14947 Solved: 6840[Submit][Status][Discuss]Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜...原创 2018-07-22 15:51:40 · 101 阅读 · 0 评论 -
HDU 6333 Harvest of Apples 【莫队】【逆元线性筛】
Problem B. Harvest of ApplesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2017 Accepted Submission(s): 784 Problem DescriptionThe...原创 2018-08-02 21:26:28 · 191 阅读 · 0 评论