题目链接:http://poj.org/problem?id=2456
题意:有一排n个牛舍,坐标分别为xi,有m头牛,希望尽可能把他们之间分开,求他们之间最近的两头牛之间的距离最大可以拉到多少。这是二分中最大化最小值的题目,英文的题目又最大又最小有的人不易理解。
思路:显然两头最近的牛的距离太大将没有一种方式安置在牛舍中,两头最近的牛距离越小就越能放置在牛舍中,所以用把答案二分出来,每个mi...
分类:
其他好文 时间:
2015-02-08 09:03:06
阅读次数:
137
微软近期Open的职位:Job Title: Software Engineer IIWork Location: Beijing, ChinaBing Index Generation team is hiring! As one of the core teams in Bing, our mi...
分类:
其他好文 时间:
2015-02-07 06:49:05
阅读次数:
148
游戏里经常用的概率算法,比如随机一个数,看它落在哪段。
这里涉及到随机数之后,看如何查找落在哪个段,可以用二分查找来优化:
#include
using namespace std;
int binary_search_nearest(int* arr, int begin, int end, int val){
if (!arr){
return -1;
}
int mi...
分类:
其他好文 时间:
2015-02-06 13:18:06
阅读次数:
149
select distinc user from instrument where created>"TO_DATE"('2015-02-05 12:00:00', 'yyyy-mm-dd hh24:mi:ss')———————————————————————————————————————————...
分类:
数据库 时间:
2015-02-06 11:05:28
阅读次数:
294
Commando War“Waiting for orders we held in the wood, word from the front never cameBy evening the sound of the gunfire was mi...
分类:
其他好文 时间:
2015-02-04 21:37:20
阅读次数:
154
陈科肇-欢迎转载,转载请注明出处,谢谢!
==================
本来打算在电脑上部署war包的,部署完之后,遇到个小问题:
Caused by: java.lang.UnsupportedClassVersionError: com/huike/sort/dao/order/DeliverylineDao : Unsupported major.minor version 5...
分类:
编程语言 时间:
2015-02-04 16:35:34
阅读次数:
202
uva 532 Dungeon Master
You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one mi...
分类:
其他好文 时间:
2015-02-02 14:11:21
阅读次数:
147
Select Ana1,RdDate,RdTime,cast(convert(varchar,RdDate,112)+' '+convert(varchar,RdTime,108) as datetime) as time,t.interval FROM
(SELECT Ana1,RdDate,RdTime,
datediff (mi,cast(convert(varchar,RdDate,1...
分类:
数据库 时间:
2015-02-02 10:50:38
阅读次数:
365
To summarize a year of time again.I use theSB of way for one year and half,so I want to write my feels about English.
I thank for my teacher mi .he told me a great many thing. forexample ' 'sometimes ,he often ask me ."what' s your name? where are y...
分类:
其他好文 时间:
2015-01-31 16:16:05
阅读次数:
1165