
二分
文章平均质量分 55
UISG103
苦逼而欢乐のstudent
展开
-
[BZOJ3393]二叉树
题目描述给定一棵二叉树,节点标号从1到n(n≤100000)。在不改变其中序遍历的情况下,请改变树的结构,使得这棵二叉树的先序遍历(前序遍历)字典序最小。输入第一行一个整数n,表示二叉树的节点数。接下来n行,每行两个整数。第i行的两个整数表示编号为i的节点的左儿子和右儿子的编号(不存在即为0)。输出输出一行n个整数,表示不改变中序遍历的情况下字典序最小的前序原创 2017-08-14 21:50:19 · 539 阅读 · 0 评论 -
[POJ3122]Pie
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number N of them, of various tastes and of various sizes. F of my friends are coming to my party and each o原创 2017-07-14 17:33:47 · 427 阅读 · 0 评论 -
[POJ1836]Alignment
In the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfied with the way his so原创 2017-07-14 18:49:45 · 333 阅读 · 0 评论 -
[数学知识]三分法
原出处:http://blog.youkuaiyun.com/u012469987/article/details/50897291三分法当二分的函数值不是递增/减,而是先增后减或者先减后增时二分就挂了。此时需要三分法,这里直接盗用hihocoder Problem 1142的图(hihocoder需要注册登陆,没登陆进不去)如图这种情况先减后增有极小,若lm比rm低(即lm对应的函数转载 2017-07-15 09:56:32 · 1347 阅读 · 0 评论 -
[POJ1905]Expanding Rods
When a thin rod of length L is heated n degrees, it expands to a new length L'=(1+n*C)*L, where C is the coefficient of heat expansion. When a thin rod is mounted on two solid walls and then heated,原创 2017-07-14 16:23:51 · 301 阅读 · 0 评论 -
[POJ2503] Babelfish
You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.InputIn原创 2017-07-15 08:41:20 · 261 阅读 · 0 评论 -
[POJ3737]UmBasketella
In recent days, people always design new things with multifunction. For instance, you can not only use cell phone to call your friends, but you can also use your cell phone take photographs or liste原创 2017-07-15 08:47:36 · 339 阅读 · 0 评论 -
[POJ3301]Texas Trip
原出处:http://blog.youkuaiyun.com/qq_37816449/article/details/75142734After a day trip with his friend Dick, Harry noticed a strange pattern of tiny holes in the door of his SUV. The local American T转载 2017-07-15 11:31:15 · 358 阅读 · 0 评论 -
[usaco gold 2016.1]生气的奶牛
题目描述在数轴x上摆放有n(2输入第一行包含N。接下来N个整数,表示干草堆的位置。所有位置在[0,1000000000]内。输出输出最小的力度R,使得所有的干草堆发生爆炸。四舍五入保留一位小数。样例输入58 10 3 11 1样例输出3.0样例解释:如果以力度3射击坐标5,则坐标3,坐标8处的干草堆会发生爆炸,然后又会引爆坐标原创 2017-07-21 16:57:52 · 509 阅读 · 0 评论 -
[BZOJ3389]信号连接
题目描述输入输出样例输入4 250 06 812 014 0样例输出5.00000000数据规模n≤100精度要求1e-6,建议保留8位输出来源 by azui题解:不存在可行方案即两点中最长的距离r>T。存在可行方案:二分两点中最长的距离r,用Floyd原创 2017-08-13 21:23:09 · 415 阅读 · 0 评论