给定一个数据集合,把这些数据分成和相等的两堆,输出所有可能的结果

给定一个数据集合,把这些数据分成和相等的两堆,输出所有可能的结果。

比如:
源数据集合-->[7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
第1种结果==> [7, 6, 1] 和 [5, 4, 3, 2]
第2种结果==> [7, 5, 2] 和 [6, 4, 3, 1]
第3种结果==> [7, 4, 3] 和 [6, 5, 2, 1]
第4种结果==> [7, 4, 2, 1] 和 [6, 5, 3]


思路:

1. 首先判断这个数据集合的和是不是偶数,只有偶数才能分成和一样的两堆数据。

2. 将数据集分成新的两个和一样的数据集合,它们的和是原来数据集和的二分之一,如SUM。得到这个值,作为期望值,

使用递归的思想,(本实现使用了Stack)。如果递归过程中Stack中的数据集和为SUM,那么剩下的数据集合也是SUM,输出这两个集合。

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Stack;

/**
* 题目:
* 给定一个数据集合,把这些数据分成和相等的两堆,输出所有可能的结果。
*
* 比如:
* 源数据集合-->[7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
* 第1种结果==> [7, 6, 1] 和 [5, 4, 3, 2]
* 第2种结果==> [7, 5, 2] 和 [6, 4, 3, 1]
* 第3种结果==> [7, 4, 3] 和 [6, 5, 2, 1]
* 第4种结果==> [7, 4, 2, 1] 和 [6, 5, 3]
*
* @author Eric
* @version 1.0
*
*/
public class FindTwoSetsWithSameSum {

// 当前Stack中所有数据的和
private int sumInStack = 0;

private Stack<Integer> stack = new Stack<Integer>();

/**
* 数据从大到小排列
*/
private static void sortByDes(int[] data) {
Arrays.sort(data);
int length = data.length;
for (int i = 0; i < length / 2; i++) {
int temp = data[i];
data[i] = data[length - i - 1];
data[length - i - 1] = temp;
}
}

private List<String> uniqueResult = new ArrayList<String>();

int count = 0;

public void populate(int[] data) {
/**
* 计算数据集的和,如果不是偶数,那么直接输出“结果不存在”。
*/
int sum = sum(data);
if (sum % 2 != 0) {
System.out.println("结果不存在!");
return;
}
/**
* 如果数据集的和为偶数,计算出平均数,为了减少递归的次数,
* 将数据从大到小排列。
*/
int average = sum / 2;
sortByDes(data);

/**
* 打印出数据集合的信息。
* 如:
* 源数据集合-->[15,14,13,11,10,9,8,7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!
*/
printDataArray(data);

populateTargetSets(average, data, 0, data.length);
}

private void populateTargetSets(int sum, int[] sourceData, int begin,
int end) {
// 判断Stack中的数据和是否等于目标值,如果是则输出当前Stack中的数据
if (sumInStack == sum) {
if (!isDuplicatedResult(stack, sourceData)) {
print(stack, sourceData);
}
}

for (int currentIndex = begin; currentIndex < end; currentIndex++) {
/*
* 如果当前Stack中的和加上当前index的数据小于等于目标值, 那么将当前的index的数据添加到Stack中去,
* 同时,将当前Stack中所有数据的和加上新添加到Stack中的数值
*/
if (sumInStack + sourceData[currentIndex] <= sum) {
stack.push(sourceData[currentIndex]);
sumInStack += sourceData[currentIndex];
// 当前index加上1,递归调用本身
populateTargetSets(sum, sourceData, currentIndex + 1, end);
sumInStack -= (Integer) stack.pop();
}

}

}

private boolean isDuplicatedResult(Stack<Integer> stack, int[] sourceData) {
return uniqueResult.contains(stack.toString());
}

private void print(Stack<Integer> stack, int[] sourceData) {
printIndexInfor();
printStack(stack);
printRemainingData(stack, sourceData);
}

private void printIndexInfor() {
System.out.print("第");
System.out.print(++count);
System.out.print("种结果==> ");
}

private void printRemainingData(Stack<Integer> stack, int[] sourceData) {
List<Integer> list = new ArrayList<Integer>();
for (int element : sourceData) {
list.add(element);
}

for (int element : stack) {
list.remove(new Integer(element));
}
System.out.print(" 和 ");
System.out.println(list.toString());

uniqueResult.add(stack.toString());
uniqueResult.add(list.toString());
}

private void printStack(Stack<Integer> stack) {
System.out.print("");
System.out.print(stack.toString());
}

private void printDataArray(int[] sourceData) {
StringBuilder sb = new StringBuilder();
sb.append('[');
for (int element : sourceData) {
sb.append(element);
sb.append(',');
}
sb.setCharAt(sb.length() - 1, ']');
System.out.print("源数据集合-->");
System.out.print(sb.toString());
System.out.println(" 分成和相等的两堆数据,有如下几种情况!");
System.out.println();
}

/**
* 数据求和。
*/
private int sum(int[] data) {
int sum = 0;
for (int element : data) {
sum += element;
}
return sum;
}

public static void main(String[] args) {
int[] sourceData = { 1, 3, 4, 5, 6, 2, 7, 8, 9, 10, 11, 13, 14, 15 };
FindTwoSetsWithSameSum finder = new FindTwoSetsWithSameSum();
finder.populate(sourceData);
}

}


源数据集合-->[15,14,13,11,10,9,8,7,6,5,4,3,2,1] 分成和相等的两堆数据,有如下几种情况!

第1种结果==> [15, 14, 13, 11, 1] 和 [10, 9, 8, 7, 6, 5, 4, 3, 2]
第2种结果==> [15, 14, 13, 10, 2] 和 [11, 9, 8, 7, 6, 5, 4, 3, 1]
第3种结果==> [15, 14, 13, 9, 3] 和 [11, 10, 8, 7, 6, 5, 4, 2, 1]
第4种结果==> [15, 14, 13, 9, 2, 1] 和 [11, 10, 8, 7, 6, 5, 4, 3]
第5种结果==> [15, 14, 13, 8, 4] 和 [11, 10, 9, 7, 6, 5, 3, 2, 1]
第6种结果==> [15, 14, 13, 8, 3, 1] 和 [11, 10, 9, 7, 6, 5, 4, 2]
第7种结果==> [15, 14, 13, 7, 5] 和 [11, 10, 9, 8, 6, 4, 3, 2, 1]
第8种结果==> [15, 14, 13, 7, 4, 1] 和 [11, 10, 9, 8, 6, 5, 3, 2]
第9种结果==> [15, 14, 13, 7, 3, 2] 和 [11, 10, 9, 8, 6, 5, 4, 1]
第10种结果==> [15, 14, 13, 6, 5, 1] 和 [11, 10, 9, 8, 7, 4, 3, 2]
第11种结果==> [15, 14, 13, 6, 4, 2] 和 [11, 10, 9, 8, 7, 5, 3, 1]
第12种结果==> [15, 14, 13, 6, 3, 2, 1] 和 [11, 10, 9, 8, 7, 5, 4]
第13种结果==> [15, 14, 13, 5, 4, 3] 和 [11, 10, 9, 8, 7, 6, 2, 1]
第14种结果==> [15, 14, 13, 5, 4, 2, 1] 和 [11, 10, 9, 8, 7, 6, 3]
第15种结果==> [15, 14, 11, 10, 4] 和 [13, 9, 8, 7, 6, 5, 3, 2, 1]
第16种结果==> [15, 14, 11, 10, 3, 1] 和 [13, 9, 8, 7, 6, 5, 4, 2]
第17种结果==> [15, 14, 11, 9, 5] 和 [13, 10, 8, 7, 6, 4, 3, 2, 1]
第18种结果==> [15, 14, 11, 9, 4, 1] 和 [13, 10, 8, 7, 6, 5, 3, 2]
第19种结果==> [15, 14, 11, 9, 3, 2] 和 [13, 10, 8, 7, 6, 5, 4, 1]
第20种结果==> [15, 14, 11, 8, 6] 和 [13, 10, 9, 7, 5, 4, 3, 2, 1]
第21种结果==> [15, 14, 11, 8, 5, 1] 和 [13, 10, 9, 7, 6, 4, 3, 2]
第22种结果==> [15, 14, 11, 8, 4, 2] 和 [13, 10, 9, 7, 6, 5, 3, 1]
第23种结果==> [15, 14, 11, 8, 3, 2, 1] 和 [13, 10, 9, 7, 6, 5, 4]
第24种结果==> [15, 14, 11, 7, 6, 1] 和 [13, 10, 9, 8, 5, 4, 3, 2]
第25种结果==> [15, 14, 11, 7, 5, 2] 和 [13, 10, 9, 8, 6, 4, 3, 1]
第26种结果==> [15, 14, 11, 7, 4, 3] 和 [13, 10, 9, 8, 6, 5, 2, 1]
第27种结果==> [15, 14, 11, 7, 4, 2, 1] 和 [13, 10, 9, 8, 6, 5, 3]
第28种结果==> [15, 14, 11, 6, 5, 3] 和 [13, 10, 9, 8, 7, 4, 2, 1]
第29种结果==> [15, 14, 11, 6, 5, 2, 1] 和 [13, 10, 9, 8, 7, 4, 3]
第30种结果==> [15, 14, 11, 6, 4, 3, 1] 和 [13, 10, 9, 8, 7, 5, 2]
第31种结果==> [15, 14, 11, 5, 4, 3, 2] 和 [13, 10, 9, 8, 7, 6, 1]
第32种结果==> [15, 14, 10, 9, 6] 和 [13, 11, 8, 7, 5, 4, 3, 2, 1]
第33种结果==> [15, 14, 10, 9, 5, 1] 和 [13, 11, 8, 7, 6, 4, 3, 2]
第34种结果==> [15, 14, 10, 9, 4, 2] 和 [13, 11, 8, 7, 6, 5, 3, 1]
第35种结果==> [15, 14, 10, 9, 3, 2, 1] 和 [13, 11, 8, 7, 6, 5, 4]
第36种结果==> [15, 14, 10, 8, 7] 和 [13, 11, 9, 6, 5, 4, 3, 2, 1]
第37种结果==> [15, 14, 10, 8, 6, 1] 和 [13, 11, 9, 7, 5, 4, 3, 2]
第38种结果==> [15, 14, 10, 8, 5, 2] 和 [13, 11, 9, 7, 6, 4, 3, 1]
第39种结果==> [15, 14, 10, 8, 4, 3] 和 [13, 11, 9, 7, 6, 5, 2, 1]
第40种结果==> [15, 14, 10, 8, 4, 2, 1] 和 [13, 11, 9, 7, 6, 5, 3]
第41种结果==> [15, 14, 10, 7, 6, 2] 和 [13, 11, 9, 8, 5, 4, 3, 1]
第42种结果==> [15, 14, 10, 7, 5, 3] 和 [13, 11, 9, 8, 6, 4, 2, 1]
第43种结果==> [15, 14, 10, 7, 5, 2, 1] 和 [13, 11, 9, 8, 6, 4, 3]
第44种结果==> [15, 14, 10, 7, 4, 3, 1] 和 [13, 11, 9, 8, 6, 5, 2]
第45种结果==> [15, 14, 10, 6, 5, 4] 和 [13, 11, 9, 8, 7, 3, 2, 1]
第46种结果==> [15, 14, 10, 6, 5, 3, 1] 和 [13, 11, 9, 8, 7, 4, 2]
第47种结果==> [15, 14, 10, 6, 4, 3, 2] 和 [13, 11, 9, 8, 7, 5, 1]
第48种结果==> [15, 14, 10, 5, 4, 3, 2, 1] 和 [13, 11, 9, 8, 7, 6]
第49种结果==> [15, 14, 9, 8, 7, 1] 和 [13, 11, 10, 6, 5, 4, 3, 2]
第50种结果==> [15, 14, 9, 8, 6, 2] 和 [13, 11, 10, 7, 5, 4, 3, 1]
第51种结果==> [15, 14, 9, 8, 5, 3] 和 [13, 11, 10, 7, 6, 4, 2, 1]
第52种结果==> [15, 14, 9, 8, 5, 2, 1] 和 [13, 11, 10, 7, 6, 4, 3]
第53种结果==> [15, 14, 9, 8, 4, 3, 1] 和 [13, 11, 10, 7, 6, 5, 2]
第54种结果==> [15, 14, 9, 7, 6, 3] 和 [13, 11, 10, 8, 5, 4, 2, 1]
第55种结果==> [15, 14, 9, 7, 6, 2, 1] 和 [13, 11, 10, 8, 5, 4, 3]
第56种结果==> [15, 14, 9, 7, 5, 4] 和 [13, 11, 10, 8, 6, 3, 2, 1]
第57种结果==> [15, 14, 9, 7, 5, 3, 1] 和 [13, 11, 10, 8, 6, 4, 2]
第58种结果==> [15, 14, 9, 7, 4, 3, 2] 和 [13, 11, 10, 8, 6, 5, 1]
第59种结果==> [15, 14, 9, 6, 5, 4, 1] 和 [13, 11, 10, 8, 7, 3, 2]
第60种结果==> [15, 14, 9, 6, 5, 3, 2] 和 [13, 11, 10, 8, 7, 4, 1]
第61种结果==> [15, 14, 9, 6, 4, 3, 2, 1] 和 [13, 11, 10, 8, 7, 5]
第62种结果==> [15, 14, 8, 7, 6, 4] 和 [13, 11, 10, 9, 5, 3, 2, 1]
第63种结果==> [15, 14, 8, 7, 6, 3, 1] 和 [13, 11, 10, 9, 5, 4, 2]
第64种结果==> [15, 14, 8, 7, 5, 4, 1] 和 [13, 11, 10, 9, 6, 3, 2]
第65种结果==> [15, 14, 8, 7, 5, 3, 2] 和 [13, 11, 10, 9, 6, 4, 1]
第66种结果==> [15, 14, 8, 7, 4, 3, 2, 1] 和 [13, 11, 10, 9, 6, 5]
第67种结果==> [15, 14, 8, 6, 5, 4, 2] 和 [13, 11, 10, 9, 7, 3, 1]
第68种结果==> [15, 14, 8, 6, 5, 3, 2, 1] 和 [13, 11, 10, 9, 7, 4]
第69种结果==> [15, 14, 7, 6, 5, 4, 3] 和 [13, 11, 10, 9, 8, 2, 1]
第70种结果==> [15, 14, 7, 6, 5, 4, 2, 1] 和 [13, 11, 10, 9, 8, 3]
第71种结果==> [15, 13, 11, 10, 5] 和 [14, 9, 8, 7, 6, 4, 3, 2, 1]
第72种结果==> [15, 13, 11, 10, 4, 1] 和 [14, 9, 8, 7, 6, 5, 3, 2]
第73种结果==> [15, 13, 11, 10, 3, 2] 和 [14, 9, 8, 7, 6, 5, 4, 1]
第74种结果==> [15, 13, 11, 9, 6] 和 [14, 10, 8, 7, 5, 4, 3, 2, 1]
第75种结果==> [15, 13, 11, 9, 5, 1] 和 [14, 10, 8, 7, 6, 4, 3, 2]
第76种结果==> [15, 13, 11, 9, 4, 2] 和 [14, 10, 8, 7, 6, 5, 3, 1]
第77种结果==> [15, 13, 11, 9, 3, 2, 1] 和 [14, 10, 8, 7, 6, 5, 4]
第78种结果==> [15, 13, 11, 8, 7] 和 [14, 10, 9, 6, 5, 4, 3, 2, 1]
第79种结果==> [15, 13, 11, 8, 6, 1] 和 [14, 10, 9, 7, 5, 4, 3, 2]
第80种结果==> [15, 13, 11, 8, 5, 2] 和 [14, 10, 9, 7, 6, 4, 3, 1]
第81种结果==> [15, 13, 11, 8, 4, 3] 和 [14, 10, 9, 7, 6, 5, 2, 1]
第82种结果==> [15, 13, 11, 8, 4, 2, 1] 和 [14, 10, 9, 7, 6, 5, 3]
第83种结果==> [15, 13, 11, 7, 6, 2] 和 [14, 10, 9, 8, 5, 4, 3, 1]
第84种结果==> [15, 13, 11, 7, 5, 3] 和 [14, 10, 9, 8, 6, 4, 2, 1]
第85种结果==> [15, 13, 11, 7, 5, 2, 1] 和 [14, 10, 9, 8, 6, 4, 3]
第86种结果==> [15, 13, 11, 7, 4, 3, 1] 和 [14, 10, 9, 8, 6, 5, 2]
第87种结果==> [15, 13, 11, 6, 5, 4] 和 [14, 10, 9, 8, 7, 3, 2, 1]
第88种结果==> [15, 13, 11, 6, 5, 3, 1] 和 [14, 10, 9, 8, 7, 4, 2]
第89种结果==> [15, 13, 11, 6, 4, 3, 2] 和 [14, 10, 9, 8, 7, 5, 1]
第90种结果==> [15, 13, 11, 5, 4, 3, 2, 1] 和 [14, 10, 9, 8, 7, 6]
第91种结果==> [15, 13, 10, 9, 7] 和 [14, 11, 8, 6, 5, 4, 3, 2, 1]
第92种结果==> [15, 13, 10, 9, 6, 1] 和 [14, 11, 8, 7, 5, 4, 3, 2]
第93种结果==> [15, 13, 10, 9, 5, 2] 和 [14, 11, 8, 7, 6, 4, 3, 1]
第94种结果==> [15, 13, 10, 9, 4, 3] 和 [14, 11, 8, 7, 6, 5, 2, 1]
第95种结果==> [15, 13, 10, 9, 4, 2, 1] 和 [14, 11, 8, 7, 6, 5, 3]
第96种结果==> [15, 13, 10, 8, 7, 1] 和 [14, 11, 9, 6, 5, 4, 3, 2]
第97种结果==> [15, 13, 10, 8, 6, 2] 和 [14, 11, 9, 7, 5, 4, 3, 1]
第98种结果==> [15, 13, 10, 8, 5, 3] 和 [14, 11, 9, 7, 6, 4, 2, 1]
第99种结果==> [15, 13, 10, 8, 5, 2, 1] 和 [14, 11, 9, 7, 6, 4, 3]
第100种结果==> [15, 13, 10, 8, 4, 3, 1] 和 [14, 11, 9, 7, 6, 5, 2]
第101种结果==> [15, 13, 10, 7, 6, 3] 和 [14, 11, 9, 8, 5, 4, 2, 1]
第102种结果==> [15, 13, 10, 7, 6, 2, 1] 和 [14, 11, 9, 8, 5, 4, 3]
第103种结果==> [15, 13, 10, 7, 5, 4] 和 [14, 11, 9, 8, 6, 3, 2, 1]
第104种结果==> [15, 13, 10, 7, 5, 3, 1] 和 [14, 11, 9, 8, 6, 4, 2]
第105种结果==> [15, 13, 10, 7, 4, 3, 2] 和 [14, 11, 9, 8, 6, 5, 1]
第106种结果==> [15, 13, 10, 6, 5, 4, 1] 和 [14, 11, 9, 8, 7, 3, 2]
第107种结果==> [15, 13, 10, 6, 5, 3, 2] 和 [14, 11, 9, 8, 7, 4, 1]
第108种结果==> [15, 13, 10, 6, 4, 3, 2, 1] 和 [14, 11, 9, 8, 7, 5]
第109种结果==> [15, 13, 9, 8, 7, 2] 和 [14, 11, 10, 6, 5, 4, 3, 1]
第110种结果==> [15, 13, 9, 8, 6, 3] 和 [14, 11, 10, 7, 5, 4, 2, 1]
第111种结果==> [15, 13, 9, 8, 6, 2, 1] 和 [14, 11, 10, 7, 5, 4, 3]
第112种结果==> [15, 13, 9, 8, 5, 4] 和 [14, 11, 10, 7, 6, 3, 2, 1]
第113种结果==> [15, 13, 9, 8, 5, 3, 1] 和 [14, 11, 10, 7, 6, 4, 2]
第114种结果==> [15, 13, 9, 8, 4, 3, 2] 和 [14, 11, 10, 7, 6, 5, 1]
第115种结果==> [15, 13, 9, 7, 6, 4] 和 [14, 11, 10, 8, 5, 3, 2, 1]
第116种结果==> [15, 13, 9, 7, 6, 3, 1] 和 [14, 11, 10, 8, 5, 4, 2]
第117种结果==> [15, 13, 9, 7, 5, 4, 1] 和 [14, 11, 10, 8, 6, 3, 2]
第118种结果==> [15, 13, 9, 7, 5, 3, 2] 和 [14, 11, 10, 8, 6, 4, 1]
第119种结果==> [15, 13, 9, 7, 4, 3, 2, 1] 和 [14, 11, 10, 8, 6, 5]
第120种结果==> [15, 13, 9, 6, 5, 4, 2] 和 [14, 11, 10, 8, 7, 3, 1]
第121种结果==> [15, 13, 9, 6, 5, 3, 2, 1] 和 [14, 11, 10, 8, 7, 4]
第122种结果==> [15, 13, 8, 7, 6, 5] 和 [14, 11, 10, 9, 4, 3, 2, 1]
第123种结果==> [15, 13, 8, 7, 6, 4, 1] 和 [14, 11, 10, 9, 5, 3, 2]
第124种结果==> [15, 13, 8, 7, 6, 3, 2] 和 [14, 11, 10, 9, 5, 4, 1]
第125种结果==> [15, 13, 8, 7, 5, 4, 2] 和 [14, 11, 10, 9, 6, 3, 1]
第126种结果==> [15, 13, 8, 7, 5, 3, 2, 1] 和 [14, 11, 10, 9, 6, 4]
第127种结果==> [15, 13, 8, 6, 5, 4, 3] 和 [14, 11, 10, 9, 7, 2, 1]
第128种结果==> [15, 13, 8, 6, 5, 4, 2, 1] 和 [14, 11, 10, 9, 7, 3]
第129种结果==> [15, 13, 7, 6, 5, 4, 3, 1] 和 [14, 11, 10, 9, 8, 2]
第130种结果==> [15, 11, 10, 9, 8, 1] 和 [14, 13, 7, 6, 5, 4, 3, 2]
第131种结果==> [15, 11, 10, 9, 7, 2] 和 [14, 13, 8, 6, 5, 4, 3, 1]
第132种结果==> [15, 11, 10, 9, 6, 3] 和 [14, 13, 8, 7, 5, 4, 2, 1]
第133种结果==> [15, 11, 10, 9, 6, 2, 1] 和 [14, 13, 8, 7, 5, 4, 3]
第134种结果==> [15, 11, 10, 9, 5, 4] 和 [14, 13, 8, 7, 6, 3, 2, 1]
第135种结果==> [15, 11, 10, 9, 5, 3, 1] 和 [14, 13, 8, 7, 6, 4, 2]
第136种结果==> [15, 11, 10, 9, 4, 3, 2] 和 [14, 13, 8, 7, 6, 5, 1]
第137种结果==> [15, 11, 10, 8, 7, 3] 和 [14, 13, 9, 6, 5, 4, 2, 1]
第138种结果==> [15, 11, 10, 8, 7, 2, 1] 和 [14, 13, 9, 6, 5, 4, 3]
第139种结果==> [15, 11, 10, 8, 6, 4] 和 [14, 13, 9, 7, 5, 3, 2, 1]
第140种结果==> [15, 11, 10, 8, 6, 3, 1] 和 [14, 13, 9, 7, 5, 4, 2]
第141种结果==> [15, 11, 10, 8, 5, 4, 1] 和 [14, 13, 9, 7, 6, 3, 2]
第142种结果==> [15, 11, 10, 8, 5, 3, 2] 和 [14, 13, 9, 7, 6, 4, 1]
第143种结果==> [15, 11, 10, 8, 4, 3, 2, 1] 和 [14, 13, 9, 7, 6, 5]
第144种结果==> [15, 11, 10, 7, 6, 5] 和 [14, 13, 9, 8, 4, 3, 2, 1]
第145种结果==> [15, 11, 10, 7, 6, 4, 1] 和 [14, 13, 9, 8, 5, 3, 2]
第146种结果==> [15, 11, 10, 7, 6, 3, 2] 和 [14, 13, 9, 8, 5, 4, 1]
第147种结果==> [15, 11, 10, 7, 5, 4, 2] 和 [14, 13, 9, 8, 6, 3, 1]
第148种结果==> [15, 11, 10, 7, 5, 3, 2, 1] 和 [14, 13, 9, 8, 6, 4]
第149种结果==> [15, 11, 10, 6, 5, 4, 3] 和 [14, 13, 9, 8, 7, 2, 1]
第150种结果==> [15, 11, 10, 6, 5, 4, 2, 1] 和 [14, 13, 9, 8, 7, 3]
第151种结果==> [15, 11, 9, 8, 7, 4] 和 [14, 13, 10, 6, 5, 3, 2, 1]
第152种结果==> [15, 11, 9, 8, 7, 3, 1] 和 [14, 13, 10, 6, 5, 4, 2]
第153种结果==> [15, 11, 9, 8, 6, 5] 和 [14, 13, 10, 7, 4, 3, 2, 1]
第154种结果==> [15, 11, 9, 8, 6, 4, 1] 和 [14, 13, 10, 7, 5, 3, 2]
第155种结果==> [15, 11, 9, 8, 6, 3, 2] 和 [14, 13, 10, 7, 5, 4, 1]
第156种结果==> [15, 11, 9, 8, 5, 4, 2] 和 [14, 13, 10, 7, 6, 3, 1]
第157种结果==> [15, 11, 9, 8, 5, 3, 2, 1] 和 [14, 13, 10, 7, 6, 4]
第158种结果==> [15, 11, 9, 7, 6, 5, 1] 和 [14, 13, 10, 8, 4, 3, 2]
第159种结果==> [15, 11, 9, 7, 6, 4, 2] 和 [14, 13, 10, 8, 5, 3, 1]
第160种结果==> [15, 11, 9, 7, 6, 3, 2, 1] 和 [14, 13, 10, 8, 5, 4]
第161种结果==> [15, 11, 9, 7, 5, 4, 3] 和 [14, 13, 10, 8, 6, 2, 1]
第162种结果==> [15, 11, 9, 7, 5, 4, 2, 1] 和 [14, 13, 10, 8, 6, 3]
第163种结果==> [15, 11, 9, 6, 5, 4, 3, 1] 和 [14, 13, 10, 8, 7, 2]
第164种结果==> [15, 11, 8, 7, 6, 5, 2] 和 [14, 13, 10, 9, 4, 3, 1]
第165种结果==> [15, 11, 8, 7, 6, 4, 3] 和 [14, 13, 10, 9, 5, 2, 1]
第166种结果==> [15, 11, 8, 7, 6, 4, 2, 1] 和 [14, 13, 10, 9, 5, 3]
第167种结果==> [15, 11, 8, 7, 5, 4, 3, 1] 和 [14, 13, 10, 9, 6, 2]
第168种结果==> [15, 11, 8, 6, 5, 4, 3, 2] 和 [14, 13, 10, 9, 7, 1]
第169种结果==> [15, 11, 7, 6, 5, 4, 3, 2, 1] 和 [14, 13, 10, 9, 8]
第170种结果==> [15, 10, 9, 8, 7, 5] 和 [14, 13, 11, 6, 4, 3, 2, 1]
第171种结果==> [15, 10, 9, 8, 7, 4, 1] 和 [14, 13, 11, 6, 5, 3, 2]
第172种结果==> [15, 10, 9, 8, 7, 3, 2] 和 [14, 13, 11, 6, 5, 4, 1]
第173种结果==> [15, 10, 9, 8, 6, 5, 1] 和 [14, 13, 11, 7, 4, 3, 2]
第174种结果==> [15, 10, 9, 8, 6, 4, 2] 和 [14, 13, 11, 7, 5, 3, 1]
第175种结果==> [15, 10, 9, 8, 6, 3, 2, 1] 和 [14, 13, 11, 7, 5, 4]
第176种结果==> [15, 10, 9, 8, 5, 4, 3] 和 [14, 13, 11, 7, 6, 2, 1]
第177种结果==> [15, 10, 9, 8, 5, 4, 2, 1] 和 [14, 13, 11, 7, 6, 3]
第178种结果==> [15, 10, 9, 7, 6, 5, 2] 和 [14, 13, 11, 8, 4, 3, 1]
第179种结果==> [15, 10, 9, 7, 6, 4, 3] 和 [14, 13, 11, 8, 5, 2, 1]
第180种结果==> [15, 10, 9, 7, 6, 4, 2, 1] 和 [14, 13, 11, 8, 5, 3]
第181种结果==> [15, 10, 9, 7, 5, 4, 3, 1] 和 [14, 13, 11, 8, 6, 2]
第182种结果==> [15, 10, 9, 6, 5, 4, 3, 2] 和 [14, 13, 11, 8, 7, 1]
第183种结果==> [15, 10, 8, 7, 6, 5, 3] 和 [14, 13, 11, 9, 4, 2, 1]
第184种结果==> [15, 10, 8, 7, 6, 5, 2, 1] 和 [14, 13, 11, 9, 4, 3]
第185种结果==> [15, 10, 8, 7, 6, 4, 3, 1] 和 [14, 13, 11, 9, 5, 2]
第186种结果==> [15, 10, 8, 7, 5, 4, 3, 2] 和 [14, 13, 11, 9, 6, 1]
第187种结果==> [15, 10, 8, 6, 5, 4, 3, 2, 1] 和 [14, 13, 11, 9, 7]
第188种结果==> [15, 9, 8, 7, 6, 5, 4] 和 [14, 13, 11, 10, 3, 2, 1]
第189种结果==> [15, 9, 8, 7, 6, 5, 3, 1] 和 [14, 13, 11, 10, 4, 2]
第190种结果==> [15, 9, 8, 7, 6, 4, 3, 2] 和 [14, 13, 11, 10, 5, 1]
第191种结果==> [15, 9, 8, 7, 5, 4, 3, 2, 1] 和 [14, 13, 11, 10, 6]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值