| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
用线段树返回离查询点最近的点的坐标即可水过!再贴一个主要函数:
void search1 (int nu, int x)
{
int mi = (tr[nu].a + tr[nu].b) >> 1 ;
if (tr[nu].a == tr[nu].b){
if (tr[nu].v) e1 = tr[nu].a;
return ;}
if (x > mi && tr[nu << 1 | 1].v) search1 (nu << 1 | 1, x) ;
if (!e1) search1 (nu << 1 , x) ;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator