Loading

02 2019 档案

摘要:拓扑排序 题目做的烦,题解写着玩 "POJ 2762 Going from u to v or from v to u?" 有向图,之间定义这样的关系,u能到达v或者v能到达u,则满足关系 观察知,即拓扑排序中队列中不能有两个节点 code "POJ 3687 Labeling Balls" 重量为 阅读全文
posted @ 2019-02-26 19:35 fridayfang 阅读(142) 评论(0) 推荐(0)
摘要:Codeforces Round 542 (Div. 2) 题目做不下去的我写一写题解 A. Be Positive 水题,考虑正数,负数个数是否$\geq \lceil \frac{n}{2} \rceil$ B. Two Cakes 给定位置大小为1...n的蛋糕,每种大小共两份,要求两个人从最 阅读全文
posted @ 2019-02-26 18:36 fridayfang 阅读(238) 评论(0) 推荐(0)
摘要:Codeforces Round #541 (Div. 2) 确认过眼神,是div2的人 a Sea Battle 题意: 将两个紧邻的矩形围起来需要的方块数 周长+4 b Draw 题意: 给定出现的分数,求最多可能出现的平局数 计算$(x_i:y_i) to (x_{i+1},y_{i+1})$ 阅读全文
posted @ 2019-02-24 16:41 fridayfang 阅读(206) 评论(0) 推荐(0)
摘要:简要记录题解思路 f:battle City bfs+优先队列 每次入队前进行标记,每次出队都上当前最短的路径 bfs+优先队列似乎就是dijkstra算法 ?? code struct Edge{ int u,v,w,next; //Edge(int u_,int v_,int w_):u(u_) 阅读全文
posted @ 2019-02-22 22:22 fridayfang 阅读(227) 评论(0) 推荐(0)
摘要:bfs+优先队列 代码 cpp //bfs // include include include include include include using namespace std; define CL(a,b) memset(a,b,sizeof(a)) const int maxm=305; 阅读全文
posted @ 2019-02-21 17:26 fridayfang 阅读(250) 评论(0) 推荐(0)
摘要:vj线段树专题题解 单点更新模板 cpp // include include include include include include using namespace std; define maxn 20010 struct poster{ int lb,rb;//left bound } 阅读全文
posted @ 2019-02-10 17:06 fridayfang 阅读(224) 评论(0) 推荐(0)
摘要:区间dp+四边形优化 "luogu:p2858" 题意 给出一列数 $v_i$,每天只能取两端的数,第 j 天取数价值为$v_i \times j$,最大价值?? 转移方程 dp[i][j] :n天卖掉i..j货物的收益 注意理解 代码 递推形式 cpp include using namespac 阅读全文
posted @ 2019-02-04 00:30 fridayfang 阅读(373) 评论(0) 推荐(0)