摘要: ① 使用增量构造法可以构造出升序数组arr的不重复子集,并且按字典序排序 #include<bits/stdc++.h> using namespace std; int arr[16]; inline void print_subset(int *index, int cur, int n)/// 阅读全文
posted @ 2017-07-11 19:51 qwerity 阅读(1005) 评论(0) 推荐(0) 编辑
摘要: 题意 : 输入正整数n,按从小到大的顺序输出所有形如abcde/fghij = n的表达式,其中a~j恰好为数字0~9的一个排列(可以有前导0),2≤n≤79。 分析 : 最暴力的方法莫过于采用数组存储0~9然后next_permutation枚举排列再带入表达式看是否满足等式,但是这样的复杂度就是 阅读全文
posted @ 2017-07-11 09:59 qwerity 阅读(152) 评论(0) 推荐(0) 编辑