2017年3月9日

codeforces 14D

摘要: 去掉一条边 剩下的2棵树的直径 乘积 求最大 列举每条边 2次bfs求直径 其实总共是 4*(n-1) 次bfs 总体时间 n-1*n; #include<stdio.h> #include<algorithm> #include<cstring> #include<string> #include 阅读全文

posted @ 2017-03-09 21:32 HelloWorld!--By-MJY 阅读(201) 评论(0) 推荐(0) 编辑

codeforces 6E

摘要: n 个数字 取一段区间 求最大最小的差 <=k 问最大的长度 这样长度的区间有几个 问长度最长的区间的l r 1 题目看不懂 2 看题解 线段树+二分 其实我也没碰到过这种的 线段树维护 l r 最大值和最小值 然后二分 i 到 l r 这一段区间能到的最右边的值 维护一下 #include<std 阅读全文

posted @ 2017-03-09 20:13 HelloWorld!--By-MJY 阅读(179) 评论(0) 推荐(0) 编辑

导航