- 博客(11)
- 资源 (2)
- 收藏
- 关注
原创 [树上莫队] BZOJ 3757 3052 4129
传送门 http://blog.csdn.net/kuribohG/article/details/41458639 http://vfleaking.blog.163.com/blog/static/174807634201311011201627/ “ 用S(v, u)代表 v到u的路径上的结点的集合。 用root来代表根结点,用lca(v, u)
2016-02-16 16:09:54 1202
原创 [N皇后 构造] BZOJ 3101 N皇后
这种题的意义何在... 传送门 http://blog.csdn.net/nike0good/article/details/41006705 以下是找到的N皇后一组解得构造法: 一、当n mod 6 != 2 或 n mod 6 != 3时,有一个解为: 2,4,6,8,...,n,1,3,5,7,...,n-1 (n为偶数) 2,4,6,8,...,n-1,1,3
2016-02-05 22:30:51 847
原创 [一般图最大匹配 带花树] BZOJ 4405 [wc2016]挑战NPC
%%VFK 神出题 神构图 传送门 http://blog.csdn.net/yihuikang/article/details/10460997 http://fanhq666.blog.163.com/blog/static/8194342620120304463580/ 模板基本是按照上面来打的 #include #include #in
2016-02-05 15:23:00 1320
原创 [Polya] BZOJ 1488 图的同构
传送门: http://blog.csdn.net/wzq_qwq/article/details/48035455 #include #include #include #include #define P 997 using namespace std; inline int Gcd(int a,int b) { if (a<b) return Gcd(b,a); ret
2016-02-05 14:11:53 924
原创 [随机增量法 最小圆覆盖] BZOJ 1366 [Balkan2002]Alien最小圆覆盖 & 1337 最小圆覆盖 & 2823 [AHOI2012]信号塔
期望O(n) 棒极了 BZOJ 2823 #include #include #include #include #define eps 1e-8 #define X first #define Y second using namespace std; typedef pair Point; int n; Point P[1000005],C; double R; inline
2016-02-04 21:00:44 1239 2
原创 [全局最小割] BZOJ 3345
最朴素的做法 n次最小割 O(mn^2) “ 关于全局最小割的问题: 首先刚才提到的集合S和T是客观存在的与最优解相关但不知道的量。S+T=全顶点集 那么一定有顶点1属于S或1属于T。 刚才又提到了对任意点s属于S,t属于T,对st求最小割即可得到全局最优解。 当点1属于S时,我们只要枚举另一个点i,强行认为它属于T,求一遍割。那么当i真的属于T的时候我们就得到最优解了。否则得到了一个没
2016-02-04 20:56:39 1035
原创 [次小生成树] Prime Kruskal
Prime #include #include #include #define MAXINT 2147483647/2 using namespace std; int a,b,w,n,m,t,tot,ntot=MAXINT; int e[5001][5001],flag[5001],pre[5000],dis[5001]; int maxd[5000][5000]; inline int
2016-02-04 20:21:12 736 1
原创 [最大生成树] BZOJ 3943 [Usaco2015 Feb]SuperBull
#include #include #include using namespace std; int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } long long result = 0; vector used(N, fa
2016-02-04 20:08:12 735
原创 [悬线法] BZOJ 3039 玉蟾宫
《浅谈用极大化思想解决最大子矩形问题》王知昆 #include #include #include #include using namespace std; typedef pair abcd; inline char nc() { static char buf[100000],*p1=buf,*p2=buf; if (p1==p2) { p2=(p1=buf)+fread(b
2016-02-04 20:01:47 869
原创 [Hash] BZOJ 4337 树的同构
哈希函数 自己乱搞一个就行了 #include #include #include #include #define cl(x) memset(x,0,sizeof(x)) #define M 13000007 #define V G[p].v using namespace std; typedef long long ll; inline char nc() { static char
2016-02-04 19:56:20 1143
原创 [阶 原根 指标]BZOJ 2219 数论之神
数论好题,总算把数论这一块遗漏的知识补齐了 题解传送: http://blog.csdn.net/regina8023/article/details/44863519 http://blog.csdn.net/popoqqq/article/details/41595187 1.【阶】 满足ax≡1(modp) 的最小的x是a关于p的阶。 记作δ(a)=x
2016-02-04 19:50:41 1238
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人