![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分法
AndreaQ
除非宇宙爆炸,地球毁灭,战争爆发,而你时日无多,否则,一切还来得及!
展开
-
POJ - 3368 Frequent values
题目链接:http://poj.org/problem?id=3368题目大意:有一个单调不减的数列a,求某区间的数出现次数最多为多少?思路: 设a数组依次为1 1 1 2 2 3 31、把a数组浓缩为一个b数组,则b为 3 2 2,即b数组存放a每个数出现的次数。2、用一个belong数组存放a中每个数对应b数组的下标。 则belong 数组为 1 1 1 2 2 3 3.3、对于任意区间,两端的数可能没有完全取完。如 区间 【2,5】为 1 1 2 2,左边的...原创 2021-03-09 16:01:10 · 99 阅读 · 0 评论 -
codeforces Vanya and Lanterns
Vanya and LanternsVanya walks late at night along a straight street of length l, lit by n lanterns. Consider the coordinate system with the beginning of the street corresponding to the原创 2015-01-09 21:53:30 · 748 阅读 · 0 评论 -
codeforces Vasya and Basketball
DescriptionVasya follows a basketball game and marks the distances from which each team makes a throw. He knows that each successful throw has value of either 2 or 3 points. A throw is worth 2 point原创 2015-01-11 19:55:33 · 772 阅读 · 0 评论