report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
N-queens problem - MarisaOJ: Marisa Online Judge

N-queens problem

Time limit: 1000 ms
Memory limit: 256 MB
Count the number of ways to place $n$ queens on a board of size $n \times n$ so that no two queens are attacking each other. An example way of placing $5$ queens: ``` X.... ...X. .X... ....X ..X.. ``` ### Input - A single integer $n$. ### Output - The number of ways to place $n$ queens. ### Constraints - $1 \le n \le 10$. ### Example Input: ``` 5 ``` Output: ``` 10 ```
Backtracking
Binary string
ABC string
Subset sum
Subset
Permutations
Group division
Knight's tour
N-queens problem
Maximum path
Knapsack
Build array
Sudoku
Minesweeper
Travelling Salesman Problem
Word search
Topic
Complete Search
Rating 800
Solution (0) Solution