![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
莫队算法/树上莫队/树上分块
等我学会后缀自动机
侠影之谜
展开
-
HDU 6534 Chika and Friendly Pairs (莫队+树状数组+离散化+预处理)
#include<bits/stdc++.h>using namespace std;#define rep(x,y,z) for(int (x)=(y);(x)<(z);x++)#define mst(x,y) memset(x,y,sizeof(x))#define ll long long#define pii pair<int,int> #def...原创 2020-02-04 10:06:42 · 115 阅读 · 0 评论 -
P2709 小B的询问 莫队算法
#include<bits/stdc++.h>using namespace std;#define rep(x,y,z) for(int (x)=(y);(x)<(z);x++)#define mst(x,y) memset(x,y,sizeof(x))#define ll long long#define pii pair<int,int> #def...原创 2020-02-03 17:14:57 · 88 阅读 · 0 评论 -
HDU 6333 Problem B. Harvest of Apples (莫队算法+数学思维)
Problem B. Harvest of ApplesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2073 Accepted Submission(s): 804 Problem DescriptionThe...原创 2018-08-02 22:54:37 · 221 阅读 · 3 评论 -
HDU 4858 项目管理 (莫队思想分块优化+暴力)
项目管理Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3664 Accepted Submission(s): 1367 Problem Description我们建造了一个大项目!这个项目有n个节点,用很多边连接起...原创 2018-08-30 23:38:03 · 174 阅读 · 0 评论 -
HDU 5213 Lucky (莫队算法+容斥定理)*
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5213#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,...原创 2018-09-18 08:11:59 · 189 阅读 · 0 评论 -
HDU 4467 Graph (莫队思想+图的分块)*
题目链接:acm.hdu.edu.cn/showproblem.php?pid=4467#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x,y) sca...原创 2018-09-14 13:42:27 · 404 阅读 · 1 评论 -
HDU 5145 NPY and girls (莫队算法+组合逆元)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5145#include<bits/stdc++.h>using namespace std;#define debug puts("YES");#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)#define read(x...原创 2018-09-20 14:23:18 · 128 阅读 · 0 评论