T1 (折半搜索) 题意: 给定一个序列,求有多少个非空子集,能划分成和相等的两份。 即[Usaco2012 Open]Balanced Cow Subsets; 数据范围n<=20,mi<=1e8,测试时打了个暴搜过了60分, 转化一下模型能知道对于每个数来说只会有3种情况, 1、没有被选; 2、 ...
分类:
其他好文 时间:
2018-10-16 17:42:51
阅读次数:
149
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl ...
分类:
其他好文 时间:
2018-09-30 20:41:26
阅读次数:
115
题目大意:给你一个序列,你可以在序列中任选一个子序列,求子序列每一项的积是一个平方数的方案数。 1<=a[i]<=70 因为任何一个大于2的数都可以表示成几个质数的幂的乘积 所以我们预处理70以内的质数,把它作为二进制状压的状态,每个在序列中出现数Hash一下,组合数推一下 所以把奇次幂的状态表示为 ...
分类:
其他好文 时间:
2018-09-24 23:25:24
阅读次数:
192
一、题目 1、审题 2、分析 给出一个整数数组,求其所有的不重复的子数组集合。 二、解答 1、思路: 方法一、采用回溯法。 ①、通过确定子集合数组的元素个数进行元素的字典排列。返回的是字典序的有序序列 ②、直接将子集合全部返回并进行回溯。 方法二、直接创建一个 List 存放所有子集,遍历数组; 每 ...
分类:
其他好文 时间:
2018-09-23 13:29:07
阅读次数:
162
78. Subsets Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate sub ...
分类:
其他好文 时间:
2018-09-22 14:28:49
阅读次数:
178
There are two direction for us to solve this problem. (1) Recursion Recursive step: T[0] conbines with findsubsets(T[1:]) Final step: if len(T)==0: re ...
分类:
其他好文 时间:
2018-09-22 12:36:21
阅读次数:
156
Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl ...
分类:
其他好文 时间:
2018-09-04 23:23:34
阅读次数:
213
题目描述 给定一个可能包含重复元素的整数数组 nums,返回该数组所有可能的子集(幂集)。 说明:解集不能包含重复的子集。 示例: 解题思路 利用回溯的思想,对于每个元素分为两种情况:不添加到子集或者添加到子集。注意因为有重复元素,所以先对整个数组排序使得重复元素到一起,若遇到重复元素,则单独处理, ...
分类:
其他好文 时间:
2018-08-20 15:42:03
阅读次数:
125
CentOS7下配置GlusterFS供Kubernetes使用[TOC]1.环境说明系统:CentOS7,/data为非系统分区挂载目录docker:1.13.1kubernetes:1.11.1glusterfs:4.1.22.GlusterFS部署2个节点,192.168.105.97、192.168.105.98使用yum安装yuminstallcentos-release-gluster
分类:
Web程序 时间:
2018-08-17 16:27:18
阅读次数:
227