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

关于字典序输出应该确定的方向数组,分两种情况。

Posted by xiexinxinlove at 2014-08-03 18:21:41 on Problem 2488
如何确定方向数组以使得能够以字典序大小输出,这里就看你的字母在横行还是竖行了,如果是在横行就是:int dir[8][2] = {{-1,-2},{1,-2},{-2,-1},{2,-1},{-2,1},{2,1},{-1,2},{1,2}};竖行就是:int dir[8][2]={-2,-1,-2,1,-1,-2,-1,2,1,-2,1,2,2,-1,2,1};我的是在横行,总之,一个原则:要保证有字母的那一侧,严格按着字典序,小的在前面,大的在后,然后数字的话就从小到大排一下。

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