Knight Travel Speed
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
Given two chessboard positions as 0-indexed coordinate pairs, determine the minimum number of moves required for a knight to move from one square to the other. The knight's position may not exceed 0 <= x < 8 on either axis.
Options
exec is denied
rejudge feature is enabled
now post-mortem time, all source codes will be revealed
Sample input:_
((0, 0), (2, 1))
((0, 0), (2, 0))
((0, 0), (0, 1))
Sample output:
1
2
3
Sample input:_
((5, 5), (5, 6))
((4, 4), (5, 5))
((0, 0), (1, 1))
Sample output:
3
2
4
Sample input:_
((0, 0), (6, 6))
((0, 0), (0, 0))
Sample output:
4
0
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | mitchs | 25 | 0.0332 | 2017/11/10 03:39:08 | 0B / 17B / 8B |
2 | rotary-o | 30 | 0.0333 | 2017/11/10 22:55:46 | 0B / 17B / 12B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | mitchs | 25 | 0.1510 | 2017/11/10 03:46:18 | 0B / 17B / 8B |
2 | rotary-o | 30 | 0.1463 | 2017/11/10 22:54:38 | 0B / 17B / 12B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | mitchs | 35 | 0.0706 | 2017/11/10 05:36:53 | 0B / 26B / 8B |
2 | llhuii | 35 | 0.0723 | 2017/11/17 23:40:30 | 0B / 25B / 9B |
3 | rolf | 56 | 0.0709 | 2017/11/12 00:45:28 | 0B / 32B / 21B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 36 | 0.1117 | 2017/11/18 02:06:52 | 0B / 25B / 10B |
2 | mitchs | 37 | 0.1137 | 2017/11/12 23:34:44 | 0B / 26B / 10B |
3 | Mr. Xcoder | 55 | 0.1310 | 2017/11/12 03:20:09 | 0B / 29B / 26B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | llhuii | 57 | 0.0312 | 2017/11/18 12:37:07 | 0B / 34B / 23B |
2 | TokusiN | 56 | 0.0233 | 2017/11/27 20:39:51 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 27 | 0.0312 | 2017/11/16 02:16:56 | 0B / 11B / 11B |
2 | mitchs | 27 | 0.0312 | 2017/11/21 02:41:47 | 0B / 11B / 11B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 44 | 0.0327 | 2019/09/11 20:53:55 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | whio | 12 | 0.1719 | 2017/11/18 02:09:37 | 5B / 5B / 2B |
2 | tails | 13 | 0.2560 | 2017/11/16 15:44:23 | 5B / 5B / 3B |
3 | tails | 10 | 0.2628 | 2017/11/24 11:34:47 | 4B / 4B / 2B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Nibbles | tails | 5 | 10000 |
2 | gs2 | tails | 10 | 5000 |
3 | Ruby | mitchs | 25 | 2000 |
4 | Ruby2 | mitchs | 25 | 2000 |
5 | sed | tails | 27 | 1851 |
6 | Python | mitchs | 35 | 1428 |
7 | Python3 | llhuii | 36 | 1388 |
8 | jq | pooq | 44 | 1136 |
9 | Scala | rotary-o | 48 | 1041 |
10 | C | TokusiN | 56 | 892 |
11 | Haskell | henkma | 60 | 833 |
return to the top page