
图论
文章平均质量分 87
czdb
这个作者很懒,什么都没留下…
展开
-
差分约束
参考博客:点击打开链接 差分约束: 给你n个点,然后给出每个店的关系,比如对于下x1-x2>=d1,x3-x4 这种题我们称为差分约束,我们根据答案所求的求建图 如果求最大值,那么我们把所有符号变为 如果求最小值,那么我们打所有符号变为>=,然后对于等式a-b>=d, 依然连一天从b到a,权值位d的边,然后求最长路 然后还需要注意各点之间的隐秘的约束关系,这里也要建边 差分约束原创 2017-09-25 13:36:48 · 327 阅读 · 0 评论 -
Layout (线性差分)
Like everyone else, cows like to stand close to their friends when queuing for feed. FJ has N (2 <= N <= 1,000) cows numbered 1..N standing along a straight line waiting for feed. The cows are standin原创 2017-09-25 14:00:11 · 613 阅读 · 0 评论 -
F. Cities Excursions(倍增)
F. Cities Excursions time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n cities in Berland. Some pairs of the原创 2017-09-28 13:40:30 · 439 阅读 · 0 评论 -
牛客练习赛 区间的连续段(建图 倍增)
题目连接: https://www.nowcoder.com/acm/contest/82/B 题目思路:首先我们容易想到处理出每个点最远能伸展到哪里,那么就是相当于一个一个连续的点,那么考虑建边,然后倍增就行了 accode #include<bits/stdc++.h> #define LL long long #define INF 0x3f3f3f3f using nam...原创 2018-04-02 16:27:19 · 323 阅读 · 0 评论