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 |
C++能过 G++过不了有可能出现x1>maxx的情况,需要对每个边加特判,有x1>maxx情况直接continue, x_1=to_gra(x_1,h,true); if(x_1>=gx2)continue; if(x_1<gx1)x_1=gx1; y_1=to_gra(y_1,h,false); if(y_1>=gy2)continue; if(y_1<gy1)y_1=gy1; y[ycnt++]=y_1; x_2=to_gra(x_2,h,true); if(x_2<=gx1)continue; if(x_2>gx2)x_2=gx2; y_2=to_gra(y_2,h,false); if(y_2<=gy1)continue; if(y_2>gy2)y_2=gy2; y[ycnt++]=y_2; addline(x_1,y_1,y_2,true); addline(x_2,y_1,y_2,false); Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator