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 |
Re:0K 0MS怎么出来的?难道直接调用输出文件?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator