1. 程式人生 > >全排序vs八皇后問題vs三角八皇后

全排序vs八皇后問題vs三角八皇后

Everyone knows about the "eight queens problem", but today you will solve a different one.
We are given triangle lattice of side n, as shown in the Figure below. A queen on the lattice can move along a straight line parallel to any of the sides of the triangle. How many queens can be placed on the lattice at most, without any two queens attacking each other?