摘要:
通过暴力或者dfs的方法可以很容易地得到n个数的全排列,可生成可重集的呢,例如给出一个数组a[],要求输出这个数组的全排列,与普通的求全排列不同,数组中很可能存在重复的数,所以方法都需要改一改: DFS #include"iostream" #include"cstring" #include"cs 阅读全文
摘要:
枚举,由已知条件推得y大于k,小于等于2K AC代码: #include"iostream"#include"cstring"using namespace std;const int maxn=20002;int a[maxn];int b[maxn];int main(){ int i,y; i 阅读全文
摘要:
Description A ring is composed of n (even number) circles as shown in diagram. Put natural numbers into each circle separately, and the sum of numbers 阅读全文
摘要:
Given a sequence of integers S = {S1, S2, ..., Sn}, you shoulddetermine what is the value of the maximum positive product involving consecutive terms 阅读全文
摘要:
Description Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0 through 9 once each, such that the 阅读全文