这题真是水题

TimeLimit: 2000/1000 MS (Java/Others)  MemoryLimit: 65536/32768 K (Java/Others)
64-bit integer IO format:%I64d
未提交 | 登录后收藏 | 已有3人收藏了本题
Problem Description
国际象棋你会吗?算出国际象棋中的knight从a点到b点至少要走n步.(默认能走到)

knight的移动方式为从(x,y)走到(x1,y1)满足|x-x1|+|y-y1|=3,且1<=|x-x1|<=2。
Input
输入多组测试数据。每组数据包括两个位置,用a-h表示列,1-8表示行。
Output
对于每组数据,输出一行"To get from xx to yy takes n knight moves.".
SampleInput
e2 e4
a1 b2
b2 c3
a1 h8
a1 h7
h8 a1
b1 c3
f6 f6
SampleOutput
To get from e2 to e4 takes 2 knight moves.
To get from a1 to b2 takes 4 knight moves.
To get from b2 to c3 takes 2 knight moves.
To get from a1 to h8 takes 6 knight moves.
To get from a1 to h7 takes 5 knight moves.
To get from h8 to a1 takes 6 knight moves.
To get from b1 to c3 takes 1 knight moves.
To get from f6 to f6 takes 0 knight moves.
Submit
题目统计信息详细
总AC数166
通过人数114
尝试人数116
总提交量252
AC率45.24%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: