Gnutella Chessmaster
Time limit3sMemory limit512 MB
Count the non-attacking bishop placements on an n by n board for each bishop count k from 1 to 2n-1, modulo 998244353.
- Level
Hard9 of 10
- Topics
- Combinatorics, Math, Divide and conquer, Dynamic programming
- Solved
- No attempts yet
Problem
Alexander has recently reached an absurdly high rating on the Chessforces competition website. His coach gave him a hard problem so that he could truly prove his skill.
Consider an chessboard. A bishop is a chess piece that attacks all positions sharing a diagonal with it. A non-attacking configuration is an arrangement of several bishops on the chessboard in which no two bishops occupy the same position and no bishop attacks another.
Alexander has to count the number of non-attacking configurations with exactly bishops for each from to . The answers can be large, so each number is taken modulo , a completely random number.
Input
The first line contains a single integer ().
Output
Print integers. The -th integer is the number of non-attacking configurations of exactly bishops on an chessboard, modulo .