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 |
可爱的堆啊~~~终于不TLE了堆,明白吗? 就是int X[90001],Y[90001],R[90001],N; void Min(int i)//keep R[1] min { int L=(i<<1),m=i; if(L<=N&&R[L]<R[m])m=L; L++; if(L<=N&&R[L]<R[m])m=L; if(m!=i) { L=R[i];R[i]=R[m];R[m]=L; L=X[i];X[i]=X[m];X[m]=L; L=Y[i];Y[i]=Y[m];Y[m]=L; Min(m); } } void Up(int i)//Add num { if(i==1)return; int F=(i>>1); if(R[F]>R[i]) { int T=R[i];R[i]=R[F];R[F]=T; T=X[i];X[i]=X[F];X[F]=T; T=Y[i];Y[i]=Y[F];Y[F]=T; Up(F); } } //PS: Accepted 932K 16MS C++ 1612B Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator