![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分
s4ul
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #639 (Div. 2) B. Card Constructions
题目链接代码#include <cstdio>#include <vector>#include <queue>#include <cstring>#include <cstdio>#include <vector>#include <cstdio>#include <vector>...原创 2020-05-07 09:19:11 · 219 阅读 · 0 评论 -
查找左边界
Alice is providing print service, while the pricing doesn’t seem to be reasonable, so people using her print service found some tricks to save money.For example, the price when printing less than 100...原创 2020-05-04 08:00:13 · 205 阅读 · 0 评论 -
最小值的最大值
Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).His C (2 <= C <...原创 2020-05-04 07:50:10 · 896 阅读 · 0 评论 -
二/三分总结
二分1.基本思想算法:当数据量很大适宜采用该方法。采用二分法查找时,数据需是排好序的。基本思想:假设数据是按升序排序的,对于给定值key,从序列的中间位置k开始比较,如果当前位置arr[k]值等于key,则查找成功;若key小于当前位置值arr[k],则在数列的前半段中查找,arr[low,mid-1];若key大于当前位置值arr[k],则在数列的后半段中继续查找arr[mid+1,...原创 2020-05-03 22:33:01 · 348 阅读 · 1 评论 -
通过精度确定边界
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, ...原创 2020-05-03 22:29:34 · 441 阅读 · 0 评论 -
最小值的最大值问题
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...原创 2020-05-03 22:19:12 · 447 阅读 · 0 评论 -
求最大值的最小值问题
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...原创 2020-05-03 21:18:49 · 828 阅读 · 0 评论 -
通过精度确定边界的二分
Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to co...原创 2020-05-03 21:10:39 · 206 阅读 · 0 评论 -
二分搜索+二分查找
Given N numbers, X1, X2, … , XN, let us calculate the difference of every pair of numbers: ∣Xi - Xj∣ (1 ≤ i < j ≤ N). We can get C(N,2) differences through this work, and now your task is to find the ...转载 2020-05-03 21:02:40 · 135 阅读 · 0 评论 -
二分查数位置,时间复杂度分析
The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the followin...原创 2020-05-03 20:13:35 · 542 阅读 · 0 评论 -
Batch Sort
You are given a table consisting of n rows and m columns. Each cell of the table contains a number, 0 or 1. In one move we can choose some row of the table and cyclically shift its values either one c...原创 2020-05-03 11:24:16 · 326 阅读 · 0 评论 -
POJ 1505 Copying Books
题意:给一些书,这些书有不同的页数,让把这些书分成k份,必须是连续的,问这些份中页数和的最大值最小是多少。Sample Input29 3100 200 300 400 500 600 700 800 9005 4100 100 100 100 100Sample Output100 200 300 400 500 / 600 700 / 800 900100 / 100 / 1...原创 2020-04-27 16:56:15 · 155 阅读 · 0 评论