摘要: Problem Description Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For examp 阅读全文
posted @ 2016-05-26 15:04 邻家那小孩儿 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input 共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量; 阅读全文
posted @ 2016-05-26 13:21 邻家那小孩儿 阅读(98) 评论(0) 推荐(0) 编辑