
二分
Viscu
勤能补拙。
展开
-
51nod1294 修改数组(二分法)
给出一个整数数组A,你可以将任何一个数修改为任意一个正整数,最终使得整个数组是严格递增的且均为正整数。问最少需要修改几个数? Input 第1行:一个数N表示序列的长度(1 <= N <= 100000)。 第2 - N + 1行:每行1个数,对应数组元素。(0 <= A[i] <= 10^9) Output 输出最少需要修改几个数使得整个数组是严格递增的。 Input示例 5 1 2 2 3 4原创 2016-10-20 15:23:31 · 434 阅读 · 0 评论 -
POJ 2785 4 Values whose Sum is 0(二分法)
4 Values whose Sum is 0 Time Limit: 15000MS Memory Limit: 228000K Total Submissions: 20385 Accepted: 6116 Case Time Limit: 5000MS Description The SUM problem can be formulated as follows: gi原创 2016-11-01 19:48:08 · 328 阅读 · 0 评论 -
hdu2899 Strange fuction(二分+精度)
Problem Description Now, 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. Input The first line of the input contains原创 2017-03-13 00:36:37 · 450 阅读 · 0 评论