随笔分类 -  差分约束

摘要:题目算法要素:Floyd 题目分析: 最开始我想当作差分约束处理,但是没调过,只有20tps。 这个题的正解思路很有意思,很容易发现点数最多只有100,边数最多只有10000,因此可以用floyd维护f[a][b]表示a是否大于b。 若f[a][b]=true,则a>b。 若f[b][a]=true 阅读全文
posted @ 2021-09-18 07:39 Mint-hexagram 阅读(117) 评论(0) 推荐(0)
摘要:基础的差分约束 #拓展 #Code #include<bits/stdc++.h> using namespace std; const int maxn=5e3+5; int n,m,a,b,c,head[maxn],dis[maxn],ecnt=-1,cnt[maxn]; bool jud=1; 阅读全文
posted @ 2021-09-04 15:41 Mint-hexagram 阅读(51) 评论(0) 推荐(0)