上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 省选Day2T2 自己的思路: 将树上所有的链存到好几个数组里,每次取出每个数组的最大值比较,将最大的计入答案。其实很接近正解了。 . 正解:将每个点的子树合成一个堆,启发式合并(由小到大)。 上代码吧 cpp include include include include define LL lo 阅读全文
posted @ 2019-05-03 22:24 蟹蟹王 阅读(286) 评论(0) 推荐(0)
摘要: NOIP2015 T1跳石头 二分,没啥好说的,不知道为啥$n=0,k=0$的特殊数据会错。 T2子串 $f[i][j][p][0/1]$表示$a$串到第$i$个字符,$b$串匹配到第$j$个字符,一共划分成$p$部分,第$i$个字符用$(1)$没用$(0)$的方案数。 $if(a[i]==b[j] 阅读全文
posted @ 2019-05-03 15:08 蟹蟹王 阅读(125) 评论(0) 推荐(0)
摘要: "当然还是洛谷的题啦" 首先 自己的思路: 知识点:装满的01背包($f[0]=0$,其他的赋值为$ inf$) 获得了70分的好成绩 很明显,$sum$会达到$1e9$,当然会超时了,想了想也不会优化。 于是开心地看了题解。 然后 定义$x[i]=0/1$表示选不选第i头牛。则要求最大的$ans$ 阅读全文
posted @ 2019-05-03 14:39 蟹蟹王 阅读(466) 评论(0) 推荐(0)
摘要: DP专题 "题目链接" 思路 $f[i][j][a][b][0/1]$表示在$(i,j)$这个格子,小a有a滴魔液,他的伙伴有b滴,上一步是小a(0)或者他的伙伴(1)吸取的魔液。 (显然)数组开不下 cpp include include include define LL long long u 阅读全文
posted @ 2019-04-25 22:25 蟹蟹王 阅读(160) 评论(0) 推荐(0)
摘要: (https://i.loli.net/2019/05/03/5ccbea67a5a45.jpg) 阅读全文
posted @ 2019-04-25 20:10 蟹蟹王 阅读(313) 评论(0) 推荐(0)
摘要: luoguP1131 。。。这道题我也不知道咋$A$的。 思路: $anst$ 距离 $s$ 的最长距离,$ansp$ 某一节点到祖先所有边的权值和这些些加过的权值和 先求出到$s$距离最长的点,其他点通过使用道具增加到这个点的长度。对于每一个节点,记录一个它的子节点到它的距离最长的点(距离$dis 阅读全文
posted @ 2019-04-11 21:55 蟹蟹王 阅读(110) 评论(0) 推荐(0)
摘要: luoguP1941 20分&50分: cpp include include include include using namespace std; const int N = 20005; int n,m,k,x[N],y[N],ans,sum,book[N]; int f[10005][10 阅读全文
posted @ 2019-04-11 20:52 蟹蟹王 阅读(212) 评论(0) 推荐(0)
摘要: 2006河南省选 思路:(参考题解) 枚举最大的边(第$i$条),从这条边开始由大到小枚举、添边,当$s$和$t$联通时,此时即为以第$i$条边为最大边的答案,比较每个答案,判断输出。 cpp include include include include using namespace std; 阅读全文
posted @ 2019-04-04 22:18 蟹蟹王 阅读(135) 评论(0) 推荐(0)
摘要: 原版复制 "大佬的题解" cpp include include include include include define LL long long define maxn 50010 define mid ((l+r) 1) using namespace std; struct edge{ 阅读全文
posted @ 2019-04-04 21:05 蟹蟹王 阅读(98) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2019-04-04 20:28 蟹蟹王 阅读(3) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页