随笔分类 -  深度优先遍历

摘要:分析:搜索,每个数字分选与不选两种情况。 #include <iostream> using namespace std; int k; int a[22]; int n; bool is_ok(int x,int sum) { if(x==n) return sum==k; return is_o 阅读全文
posted @ 2017-08-09 16:47 只有你 阅读(120) 评论(0) 推荐(0)
摘要:1042 数字0-9的数量 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注 取消关注 1042 数字0-9的数量 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 1042 数字0-9的数量 基准时间限制:1 秒 空间 阅读全文
posted @ 2017-08-06 15:08 只有你 阅读(269) 评论(0) 推荐(0)
摘要:Sum It Up 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. 阅读全文
posted @ 2017-07-19 16:31 只有你 阅读(191) 评论(0) 推荐(0)
摘要:Additive equations Problem Description We all understand that an integer set is a collection of distinct integers. Now the question is: given an integ 阅读全文
posted @ 2017-07-19 09:46 只有你 阅读(267) 评论(0) 推荐(0)
摘要:用dfs解并查集问题,水果消除的dfs解法 阅读全文
posted @ 2017-05-31 17:15 只有你 阅读(496) 评论(0) 推荐(0)