
二分
Stephencurry‘s csdn
这个作者很懒,什么都没留下…
展开
-
Gym - 101194D (二分)
熊猫先生非常喜欢冰淇淋,尤其是冰淇淋塔。一个冰淇淋塔由K个冰淇淋球堆叠成一个塔。为了使塔稳定,下面的冰淇淋球至少要有它上面的两倍大。换句话说,如果冰淇淋球从上到下的尺寸是A0, A1, A2,···,AK 1,那么A0×2 ≤ A1, A1 × 2 ≤ A2,等等。 有一天,熊猫先生在街上走着,发现一家卖冰淇淋球的商店。冰淇淋球共有N个,大小分别为B0、B1、B2、··、BN−1。潘达先生想知道这...原创 2020-04-03 22:38:00 · 235 阅读 · 0 评论 -
最长上升子序列nlogn算法
转自大神博客:https://www.cnblogs.com/mengxm-lincf/archive/2011/07/12/2104745.html 在川大oj上遇到一道题无法用n^2过于是,各种纠结,最后习得nlogn的算法 最长递增子序列,Longest Increasing Subsequence 下面我们简记为 LIS。 排序+LCS算法 以及 DP算法就忽略了,这两个太容易理解了。...转载 2020-01-09 15:41:39 · 231 阅读 · 0 评论 -
Monthly Expense (POJ-3273)(二分查找)
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤moneyi≤ 10,000) that h...原创 2019-12-23 11:53:51 · 153 阅读 · 0 评论 -
River Hopscotch (POJ-3258)(二分)
Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a ro...原创 2019-12-21 11:23:37 · 118 阅读 · 0 评论 -
Expanding Rods (POJ-1905)(二分+计算几何)
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, i...原创 2019-12-21 11:05:17 · 213 阅读 · 0 评论 -
Can you solve this equation? (HDU-2199)二分查找
Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky. Input The first line of the input contains an integer T(1<=T<...原创 2019-12-12 17:54:56 · 212 阅读 · 0 评论 -
The Parade(CodeForces - 1250J)(思路+二分)
The Berland Army is preparing for a large military parade. It is already decided that the soldiers participating in it will be divided intokkrows, and all rows will containthe samenumber of soldie...原创 2019-11-11 21:02:28 · 565 阅读 · 0 评论 -
二分
二分 前几天接触了二分,所谓二分,顾名思义,就是把一组数据每次都从中间去取,设一个key值,每次去比较,之后移动最左面的值或者右面的值,再去比较,直到求出自己需要的值。 我看过一篇大佬的文章,感觉受益匪浅:传送门 这里放上一道很基础的题。 愤怒的牛 【题目描述】 农夫 John 建造了一座很长的畜栏,它包括N (2 ≤ N ≤ 100,000)个隔间,这些小隔间依次编号为x1,....原创 2019-03-03 11:18:43 · 194 阅读 · 0 评论