摘要: Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N... 阅读全文
posted @ 2014-04-15 17:09 段少 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile... 阅读全文
posted @ 2014-04-15 12:33 段少 阅读(340) 评论(0) 推荐(0) 编辑