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

Re:0K 0MS怎么出来的?难道直接调用输出文件?

Posted by dawei007 at 2010-04-25 17:47:57 on Problem 1657
In Reply To:Re:0K 0MS怎么出来的?难道直接调用输出文件? Posted by:Snow_storm at 2009-11-25 16:31:26
> 除了象需要bfs外  
> 皇后和车不是1步到就是2步,而王的步数是min(abs(x1-x0),(y1-y0))  

	
象不用bfs 
	if( (a+b)%2 == (x2+y2)%2 )
		{
			if( (a!=x2 && abs((y2-b)/(x2-a))==1) )
				cout<<"1"<<endl;
			else
				cout<<"2"<<endl;
		}
		else
			cout<<"Inf"<<endl;

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