Knight Moves
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 a square from a1 to h8, print the number of valid knight moves from that square on a standard chessboard.
Options
exec is denied
rejudge feature is enabled
now post-mortem time, all source codes will be revealed
Sample input:_
a1
a2
a3
a4
a5
a6
a7
a8
b1
b2
b3
b4
b5
b6
b7
b8
c1
c2
c3
c4
c5
c6
c7
c8
d1
d2
d3
d4
d5
d6
d7
d8
e1
e2
e3
e4
e5
e6
e7
e8
f1
f2
f3
f4
f5
f6
f7
f8
g1
g2
g3
g4
g5
g6
g7
g8
h1
h2
h3
h4
h5
h6
h7
h8
Sample output:
2
3
4
4
4
4
3
2
3
4
6
6
6
6
4
3
4
6
8
8
8
8
6
4
4
6
8
8
8
8
6
4
4
6
8
8
8
8
6
4
4
6
8
8
8
8
6
4
3
4
6
6
6
6
4
3
2
3
4
4
4
4
3
2
Sample input:_
g7
a7
d6
f6
c2
a1
b6
a5
h7
g3
c5
c8
g2
h5
e4
h3
f2
c7
f1
h8
d4
b2
a6
g5
d3
h2
h1
g6
c6
h4
g1
c3
e2
d2
g8
b3
d7
d5
e1
b7
d1
f3
a4
g4
d8
e6
c1
a3
e7
b1
e8
f7
b5
a8
a2
b8
f8
f5
f4
e3
b4
c4
e5
h6
Sample output:
4
3
8
8
6
2
6
4
3
6
8
4
4
4
8
4
6
6
4
2
8
4
4
6
8
3
2
6
8
4
3
8
6
6
3
6
6
8
4
4
4
8
4
6
4
8
4
4
6
3
4
6
6
2
3
3
4
8
8
8
6
8
8
4
Sample input:_
a2
g3
a7
g6
b4
b8
c3
f1
d3
c6
f2
b7
a6
h1
g1
h3
g5
d8
a8
e7
a3
h6
f4
h4
d5
c2
e6
c8
g8
f6
a1
f8
f5
b3
e4
b6
e3
d1
b5
g2
g4
c5
h5
h8
c4
e1
a4
e8
e2
d6
e5
b2
h7
h2
f7
c1
g7
f3
a5
d7
d2
b1
d4
c7
Sample output:
3
6
3
6
6
3
8
4
8
8
6
4
4
2
3
4
6
4
2
6
4
4
8
4
8
6
8
4
3
8
2
4
8
6
8
6
8
4
6
4
6
8
4
2
8
4
4
4
6
8
8
4
3
3
6
4
4
8
4
6
6
3
8
6
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | rotary-o | 46 | 0.2766 | 2021/07/11 20:22:00 | 0B / 26B / 16B |
2 | teebee | 48 | 0.1860 | 2021/07/09 05:28:14 | 0B / 29B / 18B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 35 | 0.0446 | 2021/07/06 21:59:02 | 0B / 18B / 15B |
2 | teebee | 35 | 0.0458 | 2021/07/07 05:53:39 | 0B / 18B / 15B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 71 | 0.0320 | 2021/07/08 11:08:36 | 2B / 33B / 36B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | lynn | 81 | 0.0501 | 2021/07/10 00:17:53 | 0B / 51B / 29B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 53 | 0.0442 | 2021/07/07 11:44:39 | 0B / 19B / 30B |
2 | Fleur | 70 | 0.0425 | 2021/07/09 16:36:56 | 0B / ?B / ?B |
3 | McBusLuck | 68 | 0.0428 | 2021/07/14 02:39:59 | 0B / 43B / 20B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 80 | 0.2250 | 2021/07/08 14:53:36 | 0B / 30B / 41B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | teebee | 36 | 0.0578 | 2021/07/11 06:15:54 | 0B / 12B / 24B |
2 | McBusLuck | 35 | 0.0569 | 2021/07/15 00:51:16 | 0B / 11B / 24B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 13 | 0.2698 | 2021/07/07 10:41:34 | 6B / 5B / 2B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 526 | 0.0541 | 2021/07/07 14:19:15 | 0B / 290B / 236B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | rotary-o | 63 | 7.3469 | 2021/07/10 11:22:27 | 0B / 42B / 20B |
2 | rotary-o | 61 | 6.5079 | 2021/07/14 00:59:13 | 0B / 40B / 20B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | gs2 | tails | 13 | 10000 |
2 | Perl | tails | 35 | 3714 |
3 | AWK | tails (Fleur,teebee) | 35 | 3714 |
4 | xgawk | McBusLuck | 35 | 3714 |
5 | z80 | McBusLuck | 35 | 3714 |
6 | Ruby | Sisyphus (teebee) | 42 | 3095 |
7 | Ruby2 | rotary-o | 46 | 2826 |
8 | Bash | McBusLuck | 47 | 2765 |
9 | sed | tails | 53 | 2452 |
10 | Python | Dingledooper | 61 | 2131 |
11 | Scala | rotary-o | 61 | 2131 |
12 | Python3 | orthoplex | 65 | 2000 |
13 | C | tails | 71 | 1830 |
14 | Bash (builtins) | tails | 80 | 1625 |
15 | Haskell | lynn | 81 | 1604 |
16 | Java | rotary-o | 130 | 1000 |
17 | Lazy-K | tails | 526 | 247 |
return to the top page