摘要: 前言: 如果还不知道斯坦纳树的童鞋可以看这两篇博客: 我的:https://blog.csdn.net/jerry_wang119/article/details/80001711 我一开始学习的:https://blog.csdn.net/wu_tongtong/article/details/7 阅读全文
posted @ 2018-06-07 23:47 horsepower2001 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 过程: 想了很久如何求组合数C(n,m),然而 YL 同学提醒了可以直接除以 2*n*(n - 1 )。改了之后果然对了,以为一定是一次性AC 了,然而 WA 了3次,尴尬 —— 神 TM,ZC 苟看了题解说要开 long long,幡然醒悟会 int 爆炸 。 暴力: 很容易想到,可以将区间排序, 阅读全文
posted @ 2018-06-06 00:16 horsepower2001 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Day 1 >>> T1 >> 水题直接模拟AC; 考察三个知识点:1、你能不能编程 2、你会不会取模 3、你脑子抽不抽 然而第一次评测还是90,因为当模运算时 “ end == 0 ” 时需要将 end 改成 n; 代码: 1 #include <bits/stdc++.h> 2 3 const 阅读全文
posted @ 2018-05-20 14:40 horsepower2001 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 裸体,建图寻常。 #include <bits/stdc++.h> const int N = 500 + 5 ; std :: queue < int > q ; int head [ N << 8 ] , nxt [ N << 8 ] , flt [ N << 8 ] , dis [ N << 阅读全文
posted @ 2018-05-06 13:53 horsepower2001 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 重在建图 第一直觉是入门题目分纸牌,那道题是贪心的。 但是网络流标签嘛就用网络流做了。 建图:(流量,费用) 1、超级源点 src + 超级汇点 sink 2、对于仓库 i,拆成 Ai 和 Bi 两个点 2 . 1、从 Ai 向 Bi 建立 (inf,0) 2 . 2、从 Bi 向 Ai-1 和 A 阅读全文
posted @ 2018-05-06 13:50 horsepower2001 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 这道题考察对最小点覆盖的理解。 做法: 对于一个作业,它需要A的a模式和B的b模式,那么可以从a模式向b模式连一条边;可以感性的理解为每一条边就是一个作业,需要求得有多少个模式可以覆盖所有的边,也就是最小点覆盖,也就是最大匹配。 注意 : 由于A,B的机器初始模式为0,那么所有的可以用模式0完成的工 阅读全文
posted @ 2018-05-01 10:48 horsepower2001 阅读(189) 评论(0) 推荐(1) 编辑
摘要: 这是一道裸的2-Sat,只要考虑矛盾条件的判断就好了。 这是一道裸的2-Sat,只要考虑矛盾条件的判断就好了。 这是一道裸的2-Sat,只要考虑矛盾条件的判断就好了。 矛盾判断: 对于婚礼现场 x 和 y,x 的第一段可以和 y 的第一段或者第二段矛盾,同理,x 的第二段可以和 y 的第一段或者第二 阅读全文
posted @ 2018-04-30 22:55 horsepower2001 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 代码风格迥异 …… #include<bits/stdc++.h> const int N=100+10,M=100000+10; using namespace std; queue<int> q; int head[M],dis[M],flt[M],to[M],nxt[M],cn=1; int 阅读全文
posted @ 2018-04-29 09:35 horsepower2001 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 注意用当前弧优化! #include<queue> #include<cstdio> #include<cstring> #include<algorithm> const int MAXN=1e5+5; const int INF=1e9+7; int n,m; struct Edge { int 阅读全文
posted @ 2018-04-29 09:33 horsepower2001 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 注意好处理读入和读出一定用cin! #include <iostream> #include <cstring> #include <cstdio> #include <map> #define MX 80001 #define oo 12312312 #define S 1 #define T ( 阅读全文
posted @ 2018-04-29 09:31 horsepower2001 阅读(124) 评论(0) 推荐(0) 编辑