1 2 3 4
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 20 下一页
摘要: https://ac.nowcoder.com/acm/contest/7016/E 这题真没想到 考虑一个问题,删除边对极差的影响, 无论如何删除边都有办法不让让答案变大(可能相等) 利用二分答案,每次算出mid都跑一次dp看看能不能k条边以内完成,dp[x][i]表示以x为根的子树,所有点的数值 阅读全文
posted @ 2020-08-20 00:47 Lesning 阅读(119) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/551/D 单调栈的神仙题,真的nb 想法很简单,例如dcaad, 1 d 2 d > c (后面还有d,可以弹出d,然后再放置c) 3 c > ca (后面没有c了,不能弹出c) 4 ca -- > ca (a在栈里不管他) 阅读全文
posted @ 2020-08-14 01:22 Lesning 阅读(98) 评论(0) 推荐(0)
摘要: 神奇的树形DP+二分图最大权值匹配转移 dp[x][y]表示以左边的树x为根,右边的树y为根,他们有dp[x][y]个序号是重合的,若x和y不同构那就dp[x][y] = -INF; 如何转移? 给x的儿子们和y的儿子们建个二分图跑最大权值匹配,跑下来的最大权值就是儿子们的答案,很好笑,但是复杂度有 阅读全文
posted @ 2020-08-11 16:44 Lesning 阅读(325) 评论(0) 推荐(0)
摘要: 本题和cf 888G是一样的 利用分治算法 #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namespace std; const int maxn = 2e5+11; typedef 阅读全文
posted @ 2020-07-31 18:13 Lesning 阅读(172) 评论(0) 推荐(0)
摘要: 题解传送门,大佬说的非常好:https://www.luogu.com.cn/blog/xuxing/solution-at1999 对于一次删除一行的问题来说,可以优先画个网格图考虑左下点的变化方式,太强了! 阅读全文
posted @ 2020-07-22 20:40 Lesning 阅读(118) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/problem/20265 dp[a][b][c][d][e][llast]可以涂满1个块的颜色有a个,2个块的有b个。。。。。当前末尾是可以涂last个颜色的块涂的。 可以发现,如果用了一次b,b就会少一个颜色,a会增加一个颜色。原理就是这样 阅读全文
posted @ 2020-07-21 13:35 Lesning 阅读(264) 评论(0) 推荐(0)
摘要: 传送门 https://ac.nowcoder.com/acm/contest/5669/H 我写在这里了https://blog.nowcoder.net/n/589d219b9636417b903d633f6c44d2c7 阅读全文
posted @ 2020-07-21 13:11 Lesning 阅读(93) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/5667/G 题解其实有个前置知识,先整出一个O(n*m)的写法,很简单。但是需要优化。 利用bitset数1的个数计算答案,排好顺序。具体看神仙的代码吧,真的很强!我是看代码学会的 #include<iostream> #in 阅读全文
posted @ 2020-07-14 23:47 Lesning 阅读(232) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/problem/51265 割点的板子 #include<iostream> #include<cstring> #include<algorithm> #include<vector> #include<queue> using namesp 阅读全文
posted @ 2020-07-11 16:44 Lesning 阅读(136) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/justPassBy/p/5369930.html看这个就理解了,棒 阅读全文
posted @ 2020-07-11 00:50 Lesning 阅读(178) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 20 下一页