题目:在三角形的棋盘上放n皇后问题. 分析:找规律题目.依照题目的输出,能够看出构造法则: 先填奇数,后填偶数.以下我们仅仅要证明这样的构造的存在性就可以. 解法:先给出集体构造方法,从(1.n-f(n)+1) 開始填充奇数点: 填充全部的(1+2k.n-f(n)+1+k){当中f(n)就是最大填充数.1+2k<=n-f(n)+1+k} . 之后開始从(2.n-f(n)+1+k+1)開始填充偶数点,因为奇数点仅仅能攻击奇数点. 偶数点仅仅能攻击偶数点,所以仅仅要保证每行一个皇后就能够了. 证明:…