![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
cdoj题解
ltwy123
淡定淡定~
展开
-
cdoj 92 Journey lca
题意:给定一棵树, 然后加一条边, 有若干询问, 问你每一个询问(u,v), 加了这条边后可以从u到v节省多少距离。 思路: 一共三种情况, 1, 原路 2,u - x - y - v 3,u - y - x - v #include using namespace std; const int MAXN = 100010; struct node{ int to,原创 2015-09-25 12:37:35 · 393 阅读 · 0 评论 -
cdoj 1144 二分图最大匹配.. 裸题
来一道裸题~ http://acm.uestc.edu.cn/#/problem/show/1144 #include using namespace std; const int MAXN = 220; int uN,vN; int g[MAXN][MAXN]; int linker[MAXN]; bool used[MAXN]; int match[MAXN]; bool dfs(i原创 2015-10-02 19:53:31 · 457 阅读 · 0 评论 -
cdoj 1131 区间dp
男神的礼物 Time Limit: 3000/3000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status Lweb学长是集训队里公认的男神。有一天他要给美美的学姐姐准备礼物。 Lweb学长可是会魔法的哟。为了准备一份礼物,男神要加工n份材料。每一次只能加工相原创 2015-10-22 14:39:58 · 563 阅读 · 0 评论 -
cdoj 86 Divide
题意: 给你n种物品,每种物品的价值是2^a(0<=a<=1e5),每种物品有b(0<=b<=1e9)个,让你把这些物品分成两堆,让两堆之间的差值最小。做法: 首先我们从高位向低位看 1.如果这位上的个数恰好是偶数,那么是不是就可以平均分? 2.然后如果是奇数的话,是不是就要看看它后面的数能不能补足这个差值? 那么这样的话。我们先预处理一下,把所有的位都进位化成2原创 2015-10-08 14:59:56 · 534 阅读 · 0 评论 -
cdoj 84 Binary Operations
Binary Operations Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Status Bob has a sequence of N integers. They are so attractive, that原创 2015-09-25 15:46:33 · 614 阅读 · 0 评论