시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 32 MB | 88 | 34 | 22 | 36.667% |
In the FEN (Forsyth-Edwards Notation), a chessboard is described as follows:
For example:
is the FEN notation description of the following chessboard:
The chessboard of the beginning of a chess game is described in FEN as:
Your task is simple: given a chessboard description in a FEN notation you are asked to compute the number of unoccupied squares on the board which are not attacked by any piece.
Input is a sequence of lines, each line containing a FEN description of a chessboard. Note that the description does not necessarily give a legal chess position. Input lines do not contain whitespace.
For each line of input, output one line containing an integer which gives the number of unoccupied squares which are not attacked.
5k1r/2q3p1/p3p2p/1B3p1Q/n4P2/6P1/bbP2N1P/1K1RR3 rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR
3 16