摘要: 转自https://www.cnblogs.com/rmy020718/p/9546071.html int deep[N+1]; int q[N+1]= {0},h,t; int cur[N+1]; bool bfs(int S,int T) { for (int i=0; i<=n; i++) 阅读全文
posted @ 2020-01-30 11:34 AAAzhuo 阅读(110) 评论(0) 推荐(0)
摘要: katalan H(n)h(n)表示,从原点出发,每次向x或y轴正方向移动1单位,到达点(n,n),且在移动过程中不越过第一象限平分线的移动方案数。 h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)*h(0) (n>=2) h(0)=1 ,h(1)=1 简化为 阅读全文
posted @ 2020-01-26 10:29 AAAzhuo 阅读(128) 评论(0) 推荐(0)
摘要: https://blog.csdn.net/weixin_43826249/article/details/103426301 阅读全文
posted @ 2019-12-09 13:25 AAAzhuo 阅读(110) 评论(0) 推荐(0)
摘要: 贪心 #include <iostream> #include<algorithm> #include<string.h> #include<set> using namespace std; const int maxn=100010; int ans[maxn]; int a[4]; void 阅读全文
posted @ 2019-12-07 17:30 AAAzhuo 阅读(311) 评论(0) 推荐(0)
摘要: 简单模拟 #include <iostream> #include<algorithm> #include<string.h> #include<set> using namespace std; const int maxn=400010; int a[maxn]; void solve() { 阅读全文
posted @ 2019-12-07 16:41 AAAzhuo 阅读(233) 评论(0) 推荐(0)
摘要: #include <iostream> #include <malloc.h> #include <stdio.h> using namespace std; typedef struct OLNode { int i,j; int e; struct OLNode *right,*down; }O 阅读全文
posted @ 2019-12-04 09:47 AAAzhuo 阅读(293) 评论(0) 推荐(0)
摘要: 题意:一共n个点,m条线 若点a连通点b 则对于任何a<c<b,a均与b连通,若不连通,则你需要加边上去 问你需要加多少条边 采用并查集是因为 对于所有小于b并且与b连通的a 均用并查集代替 而其中一个点并查集不等于最大的b时 就需要加边上去 ans++ #include<iostream> #in 阅读全文
posted @ 2019-12-02 00:01 AAAzhuo 阅读(203) 评论(0) 推荐(0)
摘要: 题意 取一个数k 使a[i]上每一个数都可以整除k 0也可以 你可以移动a[i] 每移动一个单位向相邻单位消耗1时间 问最少消耗多少时间 如果不能 输出-1 #include <iostream> #include<algorithm> #include<queue> #include<vector 阅读全文
posted @ 2019-11-27 19:24 AAAzhuo 阅读(174) 评论(0) 推荐(0)
摘要: #include <iostream> #include<algorithm> #include<queue> #include<vector> using namespace std; const int maxn=100010; vector<int>g[maxn]; int con[maxn] 阅读全文
posted @ 2019-11-25 21:20 AAAzhuo 阅读(199) 评论(0) 推荐(0)
摘要: http://codeforces.com/contest/1257/problem/D D. Yet Another Monster Killing Problemtime limit per test2 secondsmemory limit per test256 megabytesinput 阅读全文
posted @ 2019-11-17 19:08 AAAzhuo 阅读(271) 评论(0) 推荐(0)