1 2 3 4
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要: https://ac.nowcoder.com/acm/contest/5556/A 代码今天晚上补完 #include<iostream> #include<cstring> #include<algorithm> #include<queue> #include<vector> using na 阅读全文
posted @ 2020-05-08 18:38 Lesning 阅读(156) 评论(0) 推荐(0)
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6035一棵n个结点的树,每个结点都有颜色,定义两点之间的路径长度为路径上出现的不同颜色数目,求树上所有路径的长度和。 https://blog.csdn.net/Bahuia/article/detail 阅读全文
posted @ 2020-05-06 21:38 Lesning 阅读(125) 评论(0) 推荐(0)
摘要: #include<iostream> #include<Windows.h> #include<winsock.h> #include <assert.h> #include<string> using namespace std; #pragma comment(lib, "ws2_32.lib" 阅读全文
posted @ 2020-04-23 00:34 Lesning 阅读(210) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/problem/13611 其实把,把树分成k个连通块有几种分配方法= 从树上取下k-1条边有几种取法,排列组合就行了,,,,,, #include<iostream> #include<algorithm> using namespace s 阅读全文
posted @ 2020-04-12 18:12 Lesning 阅读(135) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/5086/C 其实不难,让a堵在c到1的毕竟之路上就好了,需要注意,若是a和c同时到1号点就是no,同时到其他点就是yes。。。。坑了好久我的妈呀 代码公式含义:len a到c 1的必经路的长度,假设到x点 ans b到c加上c 阅读全文
posted @ 2020-04-07 21:56 Lesning 阅读(150) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/problem/13249 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector> using namespace s 阅读全文
posted @ 2020-04-07 18:58 Lesning 阅读(145) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/4912/A 过这个题有个前提,需要知道删除哪条边 必须是直径上的边 为什么? 如果不删直径上的边答案就不可能减少了,建议多画画试一下 抓住直径两端s和t开始树形DP, 具体看代码吧 #include<iostream> #in 阅读全文
posted @ 2020-04-04 23:20 Lesning 阅读(179) 评论(0) 推荐(0)
摘要: 如下图 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> using namespace std; int dp[1010][1010]; char list[1010]; char ans[1010] 阅读全文
posted @ 2020-04-04 18:11 Lesning 阅读(104) 评论(0) 推荐(0)
摘要: 分层图,每个转弯定义为一个操作,所以建立一个上层全是x轴,下层全是y轴,两层之间连一条权值为1的边代表转弯的代价。。挺简单的其实 https://www.luogu.com.cn/problem/P3831 #include<iostream> #include<cstring> #include< 阅读全文
posted @ 2020-03-31 20:34 Lesning 阅读(137) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/4090/F 8说了,就是个树链剖分 当xy之间的距离是奇数,就考虑重新建个1010101010--这样取值的树, 当xy之间距离是偶数,直接就完整的取异或就行了,没啥难得,树链剖分板子题8 #include<iostream> 阅读全文
posted @ 2020-03-26 19:46 Lesning 阅读(170) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页