二分查找
ykycode
安徽大学计算机学硕。
两次获得大学生数学竞赛省一等奖,且排名前列。
蓝桥杯C++组省一、国三。
毕业曾被国家电网录用,热爱代码的心让我选择了一家上市公司的C++开发岗。
后来又转行Java开发。
展开
-
离散化算法总结
其中,unique(alls.begin(), alls.end())将数组中的所有重复元素去重,返回去重后的数组的尾端点。离散化是将大范围的数字映射到小范围的区间内,适用于稀疏的区间。2. 如何算出离散化后的值(离散化后保序,使用二分)。1. 原数组中可能有重复元素,需要去重。原创 2023-12-01 23:49:10 · 560 阅读 · 0 评论 -
二分查找算法总结
二分的本质并不是单调性,而是从一半满足一半不满足的区间中找到边界点。原创 2023-11-26 13:57:00 · 570 阅读 · 0 评论 -
PAT (Advanced Level) Practise 1010. Radix (25)
1010. Radix (25)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number.Now f原创 2017-12-17 09:57:09 · 222 阅读 · 0 评论 -
HDU2899 Strange fuction
Problem DescriptionNow, here is a fuction: F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 100. InputThe first line of the input contai...原创 2018-06-01 00:23:49 · 128 阅读 · 0 评论 -
HDU2141 Can you find it?
Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+Ck ...原创 2018-06-02 00:00:16 · 131 阅读 · 0 评论