Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

C++能过 G++过不了

Posted by hszxoizjn at 2018-05-19 12:21:56 on Problem 2760
有可能出现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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator